···149149 Support for ARC770 core introduced with Rel 4.10 (Summer 2011)150150 This core has a bunch of cool new features:151151 -MMU-v3: Variable Page Sz (4k, 8k, 16k), bigger J-TLB (128x4)152152- Shared Address Spaces (for sharing TLB entires in MMU)152152+ Shared Address Spaces (for sharing TLB entries in MMU)153153 -Caches: New Prog Model, Region Flush154154 -Insns: endian swap, load-locked/store-conditional, time-stamp-ctr155155
+2-24
arch/arc/Makefile
···66# published by the Free Software Foundation.77#8899-ifeq ($(CROSS_COMPILE),)1010-ifndef CONFIG_CPU_BIG_ENDIAN1111-CROSS_COMPILE := arc-linux-1212-else1313-CROSS_COMPILE := arceb-linux-1414-endif1515-endif1616-179KBUILD_DEFCONFIG := nsim_700_defconfig18101911cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__2012cflags-$(CONFIG_ISA_ARCOMPACT) += -mA72121-cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs2222-2323-is_700 = $(shell $(CC) -dM -E - < /dev/null | grep -q "ARC700" && echo 1 || echo 0)2424-2525-ifdef CONFIG_ISA_ARCOMPACT2626-ifeq ($(is_700), 0)2727- $(error Toolchain not configured for ARCompact builds)2828-endif2929-endif3030-3131-ifdef CONFIG_ISA_ARCV23232-ifeq ($(is_700), 1)3333- $(error Toolchain not configured for ARCv2 builds)3434-endif3535-endif1313+cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs3836143715ifdef CONFIG_ARC_CURR_IN_REG3816# For a global register defintion, make sure it gets passed to every file···5779cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian5880ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB59816060-LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name)8282+LIBGCC = $(shell $(CC) $(cflags-y) --print-libgcc-file-name)61836284# Modules with short calls might break for calls into builtin-kernel6385KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
+20
arch/arc/kernel/process.c
···241241 task_thread_info(current)->thr_ptr;242242 }243243244244+245245+ /*246246+ * setup usermode thread pointer #1:247247+ * when child is picked by scheduler, __switch_to() uses @c_callee to248248+ * populate usermode callee regs: this works (despite being in a kernel249249+ * function) since special return path for child @ret_from_fork()250250+ * ensures those regs are not clobbered all the way to RTIE to usermode251251+ */252252+ c_callee->r25 = task_thread_info(p)->thr_ptr;253253+254254+#ifdef CONFIG_ARC_CURR_IN_REG255255+ /*256256+ * setup usermode thread pointer #2:257257+ * however for this special use of r25 in kernel, __switch_to() sets258258+ * r25 for kernel needs and only in the final return path is usermode259259+ * r25 setup, from pt_regs->user_r25. So set that up as well260260+ */261261+ c_regs->user_r25 = c_callee->r25;262262+#endif263263+244264 return 0;245265}246266
+11
arch/arm/boot/dts/imx53-qsb-common.dtsi
···123123 };124124};125125126126+&cpu0 {127127+ /* CPU rated to 1GHz, not 1.2GHz as per the default settings */128128+ operating-points = <129129+ /* kHz uV */130130+ 166666 850000131131+ 400000 900000132132+ 800000 1050000133133+ 1000000 1200000134134+ >;135135+};136136+126137&esdhc1 {127138 pinctrl-names = "default";128139 pinctrl-0 = <&pinctrl_esdhc1>;
···13131414#include <linux/atomic.h>1515#include <linux/cpumask.h>1616+#include <linux/sizes.h>1617#include <linux/threads.h>17181819#include <asm/cachectl.h>···81808281#endif83828484-/*8585- * One page above the stack is used for branch delay slot "emulation".8686- * See dsemul.c for details.8787- */8888-#define STACK_TOP ((TASK_SIZE & PAGE_MASK) - PAGE_SIZE)8383+#define VDSO_RANDOMIZE_SIZE (TASK_IS_32BIT_ADDR ? SZ_1M : SZ_256M)8484+8585+extern unsigned long mips_stack_top(void);8686+#define STACK_TOP mips_stack_top()89879088/*9189 * This decides where the kernel will search for a free chunk of vm
+25
arch/mips/kernel/process.c
···3232#include <linux/nmi.h>3333#include <linux/cpu.h>34343535+#include <asm/abi.h>3536#include <asm/asm.h>3637#include <asm/bootinfo.h>3738#include <asm/cpu.h>···4039#include <asm/dsp.h>4140#include <asm/fpu.h>4241#include <asm/irq.h>4242+#include <asm/mips-cps.h>4343#include <asm/msa.h>4444#include <asm/pgtable.h>4545#include <asm/mipsregs.h>···645643646644out:647645 return pc;646646+}647647+648648+unsigned long mips_stack_top(void)649649+{650650+ unsigned long top = TASK_SIZE & PAGE_MASK;651651+652652+ /* One page for branch delay slot "emulation" */653653+ top -= PAGE_SIZE;654654+655655+ /* Space for the VDSO, data page & GIC user page */656656+ top -= PAGE_ALIGN(current->thread.abi->vdso->size);657657+ top -= PAGE_SIZE;658658+ top -= mips_gic_present() ? PAGE_SIZE : 0;659659+660660+ /* Space for cache colour alignment */661661+ if (cpu_has_dc_aliases)662662+ top -= shm_align_mask + 1;663663+664664+ /* Space to randomize the VDSO base */665665+ if (current->flags & PF_RANDOMIZE)666666+ top -= VDSO_RANDOMIZE_SIZE;667667+668668+ return top;648669}649670650671/*
+28-20
arch/mips/kernel/setup.c
···846846 struct memblock_region *reg;847847 extern void plat_mem_setup(void);848848849849+ /*850850+ * Initialize boot_command_line to an innocuous but non-empty string in851851+ * order to prevent early_init_dt_scan_chosen() from copying852852+ * CONFIG_CMDLINE into it without our knowledge. We handle853853+ * CONFIG_CMDLINE ourselves below & don't want to duplicate its854854+ * content because repeating arguments can be problematic.855855+ */856856+ strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE);857857+858858+ /* call board setup routine */859859+ plat_mem_setup();860860+861861+ /*862862+ * Make sure all kernel memory is in the maps. The "UP" and863863+ * "DOWN" are opposite for initdata since if it crosses over864864+ * into another memory section you don't want that to be865865+ * freed when the initdata is freed.866866+ */867867+ arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT,868868+ PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT,869869+ BOOT_MEM_RAM);870870+ arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT,871871+ PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT,872872+ BOOT_MEM_INIT_RAM);873873+874874+ pr_info("Determined physical RAM map:\n");875875+ print_memory_map();876876+849877#if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE)850878 strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);851879#else···901873 }902874#endif903875#endif904904-905905- /* call board setup routine */906906- plat_mem_setup();907907-908908- /*909909- * Make sure all kernel memory is in the maps. The "UP" and910910- * "DOWN" are opposite for initdata since if it crosses over911911- * into another memory section you don't want that to be912912- * freed when the initdata is freed.913913- */914914- arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT,915915- PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT,916916- BOOT_MEM_RAM);917917- arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT,918918- PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT,919919- BOOT_MEM_INIT_RAM);920920-921921- pr_info("Determined physical RAM map:\n");922922- print_memory_map();923923-924876 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);925877926878 *cmdline_p = command_line;
+17-1
arch/mips/kernel/vdso.c
···1515#include <linux/ioport.h>1616#include <linux/kernel.h>1717#include <linux/mm.h>1818+#include <linux/random.h>1819#include <linux/sched.h>1920#include <linux/slab.h>2021#include <linux/timekeeper_internal.h>···9897 }9998}10099100100+static unsigned long vdso_base(void)101101+{102102+ unsigned long base;103103+104104+ /* Skip the delay slot emulation page */105105+ base = STACK_TOP + PAGE_SIZE;106106+107107+ if (current->flags & PF_RANDOMIZE) {108108+ base += get_random_int() & (VDSO_RANDOMIZE_SIZE - 1);109109+ base = PAGE_ALIGN(base);110110+ }111111+112112+ return base;113113+}114114+101115int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)102116{103117 struct mips_vdso_image *image = current->thread.abi->vdso;···153137 if (cpu_has_dc_aliases)154138 size += shm_align_mask + 1;155139156156- base = get_unmapped_area(NULL, 0, size, 0, 0);140140+ base = get_unmapped_area(NULL, vdso_base(), size, 0, 0);157141 if (IS_ERR_VALUE(base)) {158142 ret = base;159143 goto out;
···1306130613071307 pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int));1308130813091309+ /*13101310+ * Make sure the NIP points at userspace, not kernel text/data or13111311+ * elsewhere.13121312+ */13131313+ if (!__access_ok(pc, instructions_to_print * sizeof(int), USER_DS)) {13141314+ pr_info("%s[%d]: Bad NIP, not dumping instructions.\n",13151315+ current->comm, current->pid);13161316+ return;13171317+ }13181318+13091319 pr_info("%s[%d]: code: ", current->comm, current->pid);1310132013111321 for (i = 0; i < instructions_to_print; i++) {
+12-8
arch/powerpc/lib/code-patching.c
···2828{2929 int err;30303131- /* Make sure we aren't patching a freed init section */3232- if (init_mem_is_free && init_section_contains(exec_addr, 4)) {3333- pr_debug("Skipping init section patching addr: 0x%px\n", exec_addr);3434- return 0;3535- }3636-3731 __put_user_size(instr, patch_addr, 4, err);3832 if (err)3933 return err;···142148 return 0;143149}144150145145-int patch_instruction(unsigned int *addr, unsigned int instr)151151+static int do_patch_instruction(unsigned int *addr, unsigned int instr)146152{147153 int err;148154 unsigned int *patch_addr = NULL;···182188}183189#else /* !CONFIG_STRICT_KERNEL_RWX */184190185185-int patch_instruction(unsigned int *addr, unsigned int instr)191191+static int do_patch_instruction(unsigned int *addr, unsigned int instr)186192{187193 return raw_patch_instruction(addr, instr);188194}189195190196#endif /* CONFIG_STRICT_KERNEL_RWX */197197+198198+int patch_instruction(unsigned int *addr, unsigned int instr)199199+{200200+ /* Make sure we aren't patching a freed init section */201201+ if (init_mem_is_free && init_section_contains(addr, 4)) {202202+ pr_debug("Skipping init section patching addr: 0x%px\n", addr);203203+ return 0;204204+ }205205+ return do_patch_instruction(addr, instr);206206+}191207NOKPROBE_SYMBOL(patch_instruction);192208193209int patch_branch(unsigned int *addr, unsigned long target, int flags)
+3-2
arch/powerpc/mm/numa.c
···12171217 * Need to ensure that NODE_DATA is initialized for a node from12181218 * available memory (see memblock_alloc_try_nid). If unable to12191219 * init the node, then default to nearest node that has memory12201220- * installed.12201220+ * installed. Skip onlining a node if the subsystems are not12211221+ * yet initialized.12211222 */12221222- if (try_online_node(new_nid))12231223+ if (!topology_inited || try_online_node(new_nid))12231224 new_nid = first_online_node;12241225#else12251226 /*
···41414242 power_reg = of_ioremap(res, 0, 0x4, "power");43434444- printk(KERN_INFO "%s: Control reg at %llx\n",4545- op->dev.of_node->name, res->start);4444+ printk(KERN_INFO "%pOFn: Control reg at %llx\n",4545+ op->dev.of_node, res->start);46464747 if (has_button_interrupt(irq, op->dev.of_node)) {4848 if (request_irq(irq,
···797797/**798798 * rdtgroup_cbm_overlaps_pseudo_locked - Test if CBM or portion is pseudo-locked799799 * @d: RDT domain800800- * @_cbm: CBM to test800800+ * @cbm: CBM to test801801 *802802- * @d represents a cache instance and @_cbm a capacity bitmask that is803803- * considered for it. Determine if @_cbm overlaps with any existing802802+ * @d represents a cache instance and @cbm a capacity bitmask that is803803+ * considered for it. Determine if @cbm overlaps with any existing804804 * pseudo-locked region on @d.805805 *806806- * Return: true if @_cbm overlaps with pseudo-locked region on @d, false806806+ * @cbm is unsigned long, even if only 32 bits are used, to make the807807+ * bitmap functions work correctly.808808+ *809809+ * Return: true if @cbm overlaps with pseudo-locked region on @d, false807810 * otherwise.808811 */809809-bool rdtgroup_cbm_overlaps_pseudo_locked(struct rdt_domain *d, u32 _cbm)812812+bool rdtgroup_cbm_overlaps_pseudo_locked(struct rdt_domain *d, unsigned long cbm)810813{811811- unsigned long *cbm = (unsigned long *)&_cbm;812812- unsigned long *cbm_b;813814 unsigned int cbm_len;815815+ unsigned long cbm_b;814816815817 if (d->plr) {816818 cbm_len = d->plr->r->cache.cbm_len;817817- cbm_b = (unsigned long *)&d->plr->cbm;818818- if (bitmap_intersects(cbm, cbm_b, cbm_len))819819+ cbm_b = d->plr->cbm;820820+ if (bitmap_intersects(&cbm, &cbm_b, cbm_len))819821 return true;820822 }821823 return false;
+23-13
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
···975975 * is false then overlaps with any resource group or hardware entities976976 * will be considered.977977 *978978+ * @cbm is unsigned long, even if only 32 bits are used, to make the979979+ * bitmap functions work correctly.980980+ *978981 * Return: false if CBM does not overlap, true if it does.979982 */980983bool rdtgroup_cbm_overlaps(struct rdt_resource *r, struct rdt_domain *d,981981- u32 _cbm, int closid, bool exclusive)984984+ unsigned long cbm, int closid, bool exclusive)982985{983983- unsigned long *cbm = (unsigned long *)&_cbm;984984- unsigned long *ctrl_b;985986 enum rdtgrp_mode mode;987987+ unsigned long ctrl_b;986988 u32 *ctrl;987989 int i;988990989991 /* Check for any overlap with regions used by hardware directly */990992 if (!exclusive) {991991- if (bitmap_intersects(cbm,992992- (unsigned long *)&r->cache.shareable_bits,993993- r->cache.cbm_len))993993+ ctrl_b = r->cache.shareable_bits;994994+ if (bitmap_intersects(&cbm, &ctrl_b, r->cache.cbm_len))994995 return true;995996 }996997997998 /* Check for overlap with other resource groups */998999 ctrl = d->ctrl_val;9991000 for (i = 0; i < closids_supported(); i++, ctrl++) {10001000- ctrl_b = (unsigned long *)ctrl;10011001+ ctrl_b = *ctrl;10011002 mode = rdtgroup_mode_by_closid(i);10021003 if (closid_allocated(i) && i != closid &&10031004 mode != RDT_MODE_PSEUDO_LOCKSETUP) {10041004- if (bitmap_intersects(cbm, ctrl_b, r->cache.cbm_len)) {10051005+ if (bitmap_intersects(&cbm, &ctrl_b, r->cache.cbm_len)) {10051006 if (exclusive) {10061007 if (mode == RDT_MODE_EXCLUSIVE)10071008 return true;···11391138 * computed by first dividing the total cache size by the CBM length to11401139 * determine how many bytes each bit in the bitmask represents. The result11411140 * is multiplied with the number of bits set in the bitmask.11411141+ *11421142+ * @cbm is unsigned long, even if only 32 bits are used to make the11431143+ * bitmap functions work correctly.11421144 */11431145unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,11441144- struct rdt_domain *d, u32 cbm)11461146+ struct rdt_domain *d, unsigned long cbm)11451147{11461148 struct cpu_cacheinfo *ci;11471149 unsigned int size = 0;11481150 int num_b, i;1149115111501150- num_b = bitmap_weight((unsigned long *)&cbm, r->cache.cbm_len);11521152+ num_b = bitmap_weight(&cbm, r->cache.cbm_len);11511153 ci = get_cpu_cacheinfo(cpumask_any(&d->cpu_mask));11521154 for (i = 0; i < ci->num_leaves; i++) {11531155 if (ci->info_list[i].level == r->cache_level) {···23572353 u32 used_b = 0, unused_b = 0;23582354 u32 closid = rdtgrp->closid;23592355 struct rdt_resource *r;23562356+ unsigned long tmp_cbm;23602357 enum rdtgrp_mode mode;23612358 struct rdt_domain *d;23622359 int i, ret;···23952390 * modify the CBM based on system availability.23962391 */23972392 cbm_ensure_valid(&d->new_ctrl, r);23982398- if (bitmap_weight((unsigned long *) &d->new_ctrl,23992399- r->cache.cbm_len) <24002400- r->cache.min_cbm_bits) {23932393+ /*23942394+ * Assign the u32 CBM to an unsigned long to ensure23952395+ * that bitmap_weight() does not access out-of-bound23962396+ * memory.23972397+ */23982398+ tmp_cbm = d->new_ctrl;23992399+ if (bitmap_weight(&tmp_cbm, r->cache.cbm_len) <24002400+ r->cache.min_cbm_bits) {24012401 rdt_last_cmd_printf("no space on %s:%d\n",24022402 r->name, d->id);24032403 return -ENOSPC;
+8-2
arch/x86/mm/pgtable.c
···115115116116#define UNSHARED_PTRS_PER_PGD \117117 (SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)118118+#define MAX_UNSHARED_PTRS_PER_PGD \119119+ max_t(size_t, KERNEL_PGD_BOUNDARY, PTRS_PER_PGD)118120119121120122static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)···183181 * and initialize the kernel pmds here.184182 */185183#define PREALLOCATED_PMDS UNSHARED_PTRS_PER_PGD184184+#define MAX_PREALLOCATED_PMDS MAX_UNSHARED_PTRS_PER_PGD186185187186/*188187 * We allocate separate PMDs for the kernel part of the user page-table···192189 */193190#define PREALLOCATED_USER_PMDS (static_cpu_has(X86_FEATURE_PTI) ? \194191 KERNEL_PGD_PTRS : 0)192192+#define MAX_PREALLOCATED_USER_PMDS KERNEL_PGD_PTRS195193196194void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)197195{···214210215211/* No need to prepopulate any pagetable entries in non-PAE modes. */216212#define PREALLOCATED_PMDS 0213213+#define MAX_PREALLOCATED_PMDS 0217214#define PREALLOCATED_USER_PMDS 0215215+#define MAX_PREALLOCATED_USER_PMDS 0218216#endif /* CONFIG_X86_PAE */219217220218static void free_pmds(struct mm_struct *mm, pmd_t *pmds[], int count)···434428pgd_t *pgd_alloc(struct mm_struct *mm)435429{436430 pgd_t *pgd;437437- pmd_t *u_pmds[PREALLOCATED_USER_PMDS];438438- pmd_t *pmds[PREALLOCATED_PMDS];431431+ pmd_t *u_pmds[MAX_PREALLOCATED_USER_PMDS];432432+ pmd_t *pmds[MAX_PREALLOCATED_PMDS];439433440434 pgd = _pgd_alloc();441435
···900900nv50_mstc_detect(struct drm_connector *connector, bool force)901901{902902 struct nv50_mstc *mstc = nv50_mstc(connector);903903+ enum drm_connector_status conn_status;904904+ int ret;905905+903906 if (!mstc->port)904907 return connector_status_disconnected;905905- return drm_dp_mst_detect_port(connector, mstc->port->mgr, mstc->port);908908+909909+ ret = pm_runtime_get_sync(connector->dev->dev);910910+ if (ret < 0 && ret != -EACCES)911911+ return connector_status_disconnected;912912+913913+ conn_status = drm_dp_mst_detect_port(connector, mstc->port->mgr,914914+ mstc->port);915915+916916+ pm_runtime_mark_last_busy(connector->dev->dev);917917+ pm_runtime_put_autosuspend(connector->dev->dev);918918+ return conn_status;906919}907920908921static void
+5-3
drivers/hv/connection.c
···7676 __u32 version)7777{7878 int ret = 0;7979+ unsigned int cur_cpu;7980 struct vmbus_channel_initiate_contact *msg;8081 unsigned long flags;8182···119118 * the CPU attempting to connect may not be CPU 0.120119 */121120 if (version >= VERSION_WIN8_1) {122122- msg->target_vcpu =123123- hv_cpu_number_to_vp_number(smp_processor_id());124124- vmbus_connection.connect_cpu = smp_processor_id();121121+ cur_cpu = get_cpu();122122+ msg->target_vcpu = hv_cpu_number_to_vp_number(cur_cpu);123123+ vmbus_connection.connect_cpu = cur_cpu;124124+ put_cpu();125125 } else {126126 msg->target_vcpu = 0;127127 vmbus_connection.connect_cpu = 0;
···544544 int shrink = 0;545545 int c;546546547547+ if (!mr->allocated_from_cache)548548+ return;549549+547550 c = order2idx(dev, mr->order);548551 if (c < 0 || c >= MAX_MR_CACHE_ENTRIES) {549552 mlx5_ib_warn(dev, "order %d, cache index %d\n", mr->order, c);···16501647 umem = NULL;16511648 }16521649#endif16531653-16541650 clean_mr(dev, mr);1655165116521652+ /*16531653+ * We should unregister the DMA address from the HCA before16541654+ * remove the DMA mapping.16551655+ */16561656+ mlx5_mr_cache_free(dev, mr);16561657 if (umem) {16571658 ib_umem_release(umem);16581659 atomic_sub(npages, &dev->mdev->priv.reg_pages);16591660 }16601660-16611661 if (!mr->allocated_from_cache)16621662 kfree(mr);16631663- else16641664- mlx5_mr_cache_free(dev, mr);16651663}1666166416671665int mlx5_ib_dereg_mr(struct ib_mr *ibmr)
···13951395 for (i = 0; i < I8042_NUM_PORTS; i++) {13961396 struct serio *serio = i8042_ports[i].serio;1397139713981398- if (serio) {13991399- printk(KERN_INFO "serio: %s at %#lx,%#lx irq %d\n",14001400- serio->name,14011401- (unsigned long) I8042_DATA_REG,14021402- (unsigned long) I8042_COMMAND_REG,14031403- i8042_ports[i].irq);14041404- serio_register_port(serio);14051405- device_set_wakeup_capable(&serio->dev, true);14061406- }13981398+ if (!serio)13991399+ continue;14001400+14011401+ printk(KERN_INFO "serio: %s at %#lx,%#lx irq %d\n",14021402+ serio->name,14031403+ (unsigned long) I8042_DATA_REG,14041404+ (unsigned long) I8042_COMMAND_REG,14051405+ i8042_ports[i].irq);14061406+ serio_register_port(serio);14071407+ device_set_wakeup_capable(&serio->dev, true);14081408+14091409+ /*14101410+ * On platforms using suspend-to-idle, allow the keyboard to14111411+ * wake up the system from sleep by enabling keyboard wakeups14121412+ * by default. This is consistent with keyboard wakeup14131413+ * behavior on many platforms using suspend-to-RAM (ACPI S3)14141414+ * by default.14151415+ */14161416+ if (pm_suspend_via_s2idle() && i == I8042_KBD_PORT_NO)14171417+ device_set_wakeup_enable(&serio->dev, true);14071418 }14081419}14091420
+2-3
drivers/md/dm-cache-target.c
···34843484 int r;3485348534863486 migration_cache = KMEM_CACHE(dm_cache_migration, 0);34873487- if (!migration_cache) {34883488- dm_unregister_target(&cache_target);34873487+ if (!migration_cache)34893488 return -ENOMEM;34903490- }3491348934923490 r = dm_register_target(&cache_target);34933491 if (r) {34943492 DMERR("cache target registration failed: %d", r);34933493+ kmem_cache_destroy(migration_cache);34953494 return r;34963495 }34973496
···11551155EXPORT_SYMBOL_GPL(dm_accept_partial_bio);1156115611571157/*11581158- * The zone descriptors obtained with a zone report indicate11591159- * zone positions within the target device. The zone descriptors11601160- * must be remapped to match their position within the dm device.11611161- * A target may call dm_remap_zone_report after completion of a11621162- * REQ_OP_ZONE_REPORT bio to remap the zone descriptors obtained11631163- * from the target device mapping to the dm device.11581158+ * The zone descriptors obtained with a zone report indicate zone positions11591159+ * within the target backing device, regardless of that device is a partition11601160+ * and regardless of the target mapping start sector on the device or partition.11611161+ * The zone descriptors start sector and write pointer position must be adjusted11621162+ * to match their relative position within the dm device.11631163+ * A target may call dm_remap_zone_report() after completion of a11641164+ * REQ_OP_ZONE_REPORT bio to remap the zone descriptors obtained from the11651165+ * backing device.11641166 */11651167void dm_remap_zone_report(struct dm_target *ti, struct bio *bio, sector_t start)11661168{···11731171 struct blk_zone *zone;11741172 unsigned int nr_rep = 0;11751173 unsigned int ofst;11741174+ sector_t part_offset;11761175 struct bio_vec bvec;11771176 struct bvec_iter iter;11781177 void *addr;1179117811801179 if (bio->bi_status)11811180 return;11811181+11821182+ /*11831183+ * bio sector was incremented by the request size on completion. Taking11841184+ * into account the original request sector, the target start offset on11851185+ * the backing device and the target mapping offset (ti->begin), the11861186+ * start sector of the backing device. The partition offset is always 011871187+ * if the target uses a whole device.11881188+ */11891189+ part_offset = bio->bi_iter.bi_sector + ti->begin - (start + bio_end_sector(report_bio));1182119011831191 /*11841192 * Remap the start sector of the reported zones. For sequential zones,···12071195 /* Set zones start sector */12081196 while (hdr->nr_zones && ofst < bvec.bv_len) {12091197 zone = addr + ofst;11981198+ zone->start -= part_offset;12101199 if (zone->start >= start + ti->len) {12111200 hdr->nr_zones = 0;12121201 break;···12191206 else if (zone->cond == BLK_ZONE_COND_EMPTY)12201207 zone->wp = zone->start;12211208 else12221222- zone->wp = zone->wp + ti->begin - start;12091209+ zone->wp = zone->wp + ti->begin - start - part_offset;12231210 }12241211 ofst += sizeof(struct blk_zone);12251212 hdr->nr_zones--;
+10
drivers/mmc/core/block.c
···1371137113721372 if (brq->data.blocks > 1) {13731373 /*13741374+ * Some SD cards in SPI mode return a CRC error or even lock up13751375+ * completely when trying to read the last block using a13761376+ * multiblock read command.13771377+ */13781378+ if (mmc_host_is_spi(card->host) && (rq_data_dir(req) == READ) &&13791379+ (blk_rq_pos(req) + blk_rq_sectors(req) ==13801380+ get_capacity(md->disk)))13811381+ brq->data.blocks--;13821382+13831383+ /*13741384 * After a read error, we redo the request one sector13751385 * at a time in order to accurately determine which13761386 * sectors can be read successfully.
···15951595 if (rc)15961596 return rc;1597159715981598- ena_init_napi(adapter);15991599-16001598 ena_change_mtu(adapter->netdev, adapter->netdev->mtu);1601159916021600 ena_refill_all_rx_bufs(adapter);···17511753 netdev_dbg(adapter->netdev, "%s\n", __func__);1752175417531755 ena_setup_io_intr(adapter);17561756+17571757+ /* napi poll functions should be initialized before running17581758+ * request_irq(), to handle a rare condition where there is a pending17591759+ * interrupt, causing the ISR to fire immediately while the poll17601760+ * function wasn't set yet, causing a null dereference17611761+ */17621762+ ena_init_napi(adapter);1754176317551764 rc = ena_request_io_irq(adapter);17561765 if (rc)···26912686 ena_free_mgmnt_irq(adapter);26922687 ena_disable_msix(adapter);26932688err_device_destroy:26892689+ ena_com_abort_admin_commands(ena_dev);26902690+ ena_com_wait_for_abort_completion(ena_dev);26942691 ena_com_admin_destroy(ena_dev);26922692+ ena_com_mmio_reg_read_request_destroy(ena_dev);26932693+ ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE);26952694err:26962695 clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags);26972696 clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);···3209320032103201static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev)32113202{32123212- int release_bars;32033203+ int release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;3213320432143214- if (ena_dev->mem_bar)32153215- devm_iounmap(&pdev->dev, ena_dev->mem_bar);32163216-32173217- if (ena_dev->reg_bar)32183218- devm_iounmap(&pdev->dev, ena_dev->reg_bar);32193219-32203220- release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;32213205 pci_release_selected_regions(pdev, release_bars);32223206}32233207
···42694269 RTL_W32(tp, RxConfig, RX_FIFO_THRESH | RX_DMA_BURST);42704270 break;42714271 case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_24:42724272- case RTL_GIGA_MAC_VER_34:42734273- case RTL_GIGA_MAC_VER_35:42724272+ case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_36:42734273+ case RTL_GIGA_MAC_VER_38:42744274 RTL_W32(tp, RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);42754275 break;42764276 case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
+4-1
drivers/net/ethernet/socionext/netsec.c
···735735 u16 idx = dring->tail;736736 struct netsec_de *de = dring->vaddr + (DESC_SZ * idx);737737738738- if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD))738738+ if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD)) {739739+ /* reading the register clears the irq */740740+ netsec_read(priv, NETSEC_REG_NRM_RX_PKTCNT);739741 break;742742+ }740743741744 /* This barrier is needed to keep us from reading742745 * any other fields out of the netsec_de until we have
-2
drivers/net/phy/sfp.c
···163163/* Give this long for the PHY to reset. */164164#define T_PHY_RESET_MS 50165165166166-static DEFINE_MUTEX(sfp_mutex);167167-168166struct sff_data {169167 unsigned int gpios;170168 bool (*module_supported)(const struct sfp_eeprom_id *id);
···13171317 if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {13181318 dev_info(dev, "Suspend without wake params -- powering down card\n");13191319 if (priv->fw_ready) {13201320+ ret = lbs_suspend(priv);13211321+ if (ret)13221322+ return ret;13231323+13201324 priv->power_up_on_resume = true;13211325 if_sdio_power_off(card);13221326 }
···771771 struct of_phandle_args args;772772 int i, rc;773773774774+ if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)775775+ return;776776+774777 np = of_find_node_by_path("/testcase-data/interrupts/interrupts0");775778 if (!np) {776779 pr_err("missing testcase data\n");···847844 struct device_node *np;848845 struct of_phandle_args args;849846 int i, rc;847847+848848+ if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)849849+ return;850850851851 np = of_find_node_by_path("/testcase-data/interrupts/interrupts-extended0");852852 if (!np) {···10071001 pdev = of_find_device_by_node(np);10081002 unittest(pdev, "device 1 creation failed\n");1009100310101010- irq = platform_get_irq(pdev, 0);10111011- unittest(irq == -EPROBE_DEFER, "device deferred probe failed - %d\n", irq);10041004+ if (!(of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)) {10051005+ irq = platform_get_irq(pdev, 0);10061006+ unittest(irq == -EPROBE_DEFER,10071007+ "device deferred probe failed - %d\n", irq);1012100810131013- /* Test that a parsing failure does not return -EPROBE_DEFER */10141014- np = of_find_node_by_path("/testcase-data/testcase-device2");10151015- pdev = of_find_device_by_node(np);10161016- unittest(pdev, "device 2 creation failed\n");10171017- irq = platform_get_irq(pdev, 0);10181018- unittest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq);10091009+ /* Test that a parsing failure does not return -EPROBE_DEFER */10101010+ np = of_find_node_by_path("/testcase-data/testcase-device2");10111011+ pdev = of_find_device_by_node(np);10121012+ unittest(pdev, "device 2 creation failed\n");10131013+ irq = platform_get_irq(pdev, 0);10141014+ unittest(irq < 0 && irq != -EPROBE_DEFER,10151015+ "device parsing error failed - %d\n", irq);10161016+ }1019101710201018 np = of_find_node_by_path("/testcase-data/platform-tests");10211019 unittest(np, "No testcase data in device tree\n");
+2-2
drivers/pci/controller/pcie-cadence.c
···180180 return 0;181181 }182182183183- phy = devm_kzalloc(dev, sizeof(*phy) * phy_count, GFP_KERNEL);183183+ phy = devm_kcalloc(dev, phy_count, sizeof(*phy), GFP_KERNEL);184184 if (!phy)185185 return -ENOMEM;186186187187- link = devm_kzalloc(dev, sizeof(*link) * phy_count, GFP_KERNEL);187187+ link = devm_kcalloc(dev, phy_count, sizeof(*link), GFP_KERNEL);188188 if (!link)189189 return -ENOMEM;190190
+12-1
drivers/pinctrl/pinctrl-mcp23s08.c
···636636 return err;637637 }638638639639+ return 0;640640+}641641+642642+static int mcp23s08_irqchip_setup(struct mcp23s08 *mcp)643643+{644644+ struct gpio_chip *chip = &mcp->chip;645645+ int err;646646+639647 err = gpiochip_irqchip_add_nested(chip,640648 &mcp23s08_irq_chip,641649 0,···920912 }921913922914 if (mcp->irq && mcp->irq_controller) {923923- ret = mcp23s08_irq_setup(mcp);915915+ ret = mcp23s08_irqchip_setup(mcp);924916 if (ret)925917 goto fail;926918 }···951943 ret = PTR_ERR(mcp->pctldev);952944 goto fail;953945 }946946+947947+ if (mcp->irq)948948+ ret = mcp23s08_irq_setup(mcp);954949955950fail:956951 if (ret < 0)
+1-1
drivers/platform/chrome/cros_ec_proto.c
···520520 ret = cros_ec_cmd_xfer(ec_dev, msg);521521 if (ret > 0) {522522 ec_dev->event_size = ret - 1;523523- memcpy(&ec_dev->event_data, msg->data, ec_dev->event_size);523523+ memcpy(&ec_dev->event_data, msg->data, ret);524524 }525525526526 return ret;
+8-3
drivers/s390/char/sclp_early_core.c
···210210 * Output one or more lines of text on the SCLP console (VT220 and /211211 * or line-mode).212212 */213213-void __sclp_early_printk(const char *str, unsigned int len)213213+void __sclp_early_printk(const char *str, unsigned int len, unsigned int force)214214{215215 int have_linemode, have_vt220;216216217217- if (sclp_init_state != sclp_init_state_uninitialized)217217+ if (!force && sclp_init_state != sclp_init_state_uninitialized)218218 return;219219 if (sclp_early_setup(0, &have_linemode, &have_vt220) != 0)220220 return;···227227228228void sclp_early_printk(const char *str)229229{230230- __sclp_early_printk(str, strlen(str));230230+ __sclp_early_printk(str, strlen(str), 0);231231+}232232+233233+void sclp_early_printk_force(const char *str)234234+{235235+ __sclp_early_printk(str, strlen(str), 1);231236}
+1-1
drivers/s390/cio/vfio_ccw_cp.c
···163163164164 for (i = 0; i < pat->pat_nr; i++, pa++)165165 for (j = 0; j < pa->pa_nr; j++)166166- if (pa->pa_iova_pfn[i] == iova_pfn)166166+ if (pa->pa_iova_pfn[j] == iova_pfn)167167 return true;168168169169 return false;
···120120 */121121static dma_addr_t fbpr_a;122122static size_t fbpr_sz;123123+static int __bman_probed;123124124125static int bman_fbpr(struct reserved_mem *rmem)125126{···167166 return IRQ_HANDLED;168167}169168169169+int bman_is_probed(void)170170+{171171+ return __bman_probed;172172+}173173+EXPORT_SYMBOL_GPL(bman_is_probed);174174+170175static int fsl_bman_probe(struct platform_device *pdev)171176{172177 int ret, err_irq;···181174 struct resource *res;182175 u16 id, bm_pool_cnt;183176 u8 major, minor;177177+178178+ __bman_probed = -1;184179185180 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);186181 if (!res) {···263254 0, bm_pool_cnt - 1, ret);264255 return ret;265256 }257257+258258+ __bman_probed = 1;266259267260 return 0;268261};
+11
drivers/soc/fsl/qbman/qman_ccsr.c
···273273static u32 __iomem *qm_ccsr_start;274274/* A SDQCR mask comprising all the available/visible pool channels */275275static u32 qm_pools_sdqcr;276276+static int __qman_probed;276277277278static inline u32 qm_ccsr_in(u32 offset)278279{···687686 return 0;688687}689688689689+int qman_is_probed(void)690690+{691691+ return __qman_probed;692692+}693693+EXPORT_SYMBOL_GPL(qman_is_probed);694694+690695static int fsl_qman_probe(struct platform_device *pdev)691696{692697 struct device *dev = &pdev->dev;···701694 int ret, err_irq;702695 u16 id;703696 u8 major, minor;697697+698698+ __qman_probed = -1;704699705700 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);706701 if (!res) {···836827 ret = qman_wq_alloc();837828 if (ret)838829 return ret;830830+831831+ __qman_probed = 1;839832840833 return 0;841834}
+8
drivers/soc/fsl/qbman/qman_portal.c
···227227 int irq, cpu, err;228228 u32 val;229229230230+ err = qman_is_probed();231231+ if (!err)232232+ return -EPROBE_DEFER;233233+ if (err < 0) {234234+ dev_err(&pdev->dev, "failing probe due to qman probe error\n");235235+ return -ENODEV;236236+ }237237+230238 pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);231239 if (!pcfg)232240 return -ENOMEM;
+20-29
drivers/thunderbolt/icm.c
···738738 u8 link, depth;739739 u64 route;740740741741- /*742742- * After NVM upgrade adding root switch device fails because we743743- * initiated reset. During that time ICM might still send744744- * XDomain connected message which we ignore here.745745- */746746- if (!tb->root_switch)747747- return;748748-749741 link = pkg->link_info & ICM_LINK_INFO_LINK_MASK;750742 depth = (pkg->link_info & ICM_LINK_INFO_DEPTH_MASK) >>751743 ICM_LINK_INFO_DEPTH_SHIFT;···10271035 * packet for now.10281036 */10291037 if (pkg->hdr.packet_id)10301030- return;10311031-10321032- /*10331033- * After NVM upgrade adding root switch device fails because we10341034- * initiated reset. During that time ICM might still send device10351035- * connected message which we ignore here.10361036- */10371037- if (!tb->root_switch)10381038 return;1039103910401040 route = get_route(pkg->route_hi, pkg->route_lo);···1392140813931409 mutex_lock(&tb->lock);1394141013951395- switch (n->pkg->code) {13961396- case ICM_EVENT_DEVICE_CONNECTED:13971397- icm->device_connected(tb, n->pkg);13981398- break;13991399- case ICM_EVENT_DEVICE_DISCONNECTED:14001400- icm->device_disconnected(tb, n->pkg);14011401- break;14021402- case ICM_EVENT_XDOMAIN_CONNECTED:14031403- icm->xdomain_connected(tb, n->pkg);14041404- break;14051405- case ICM_EVENT_XDOMAIN_DISCONNECTED:14061406- icm->xdomain_disconnected(tb, n->pkg);14071407- break;14111411+ /*14121412+ * When the domain is stopped we flush its workqueue but before14131413+ * that the root switch is removed. In that case we should treat14141414+ * the queued events as being canceled.14151415+ */14161416+ if (tb->root_switch) {14171417+ switch (n->pkg->code) {14181418+ case ICM_EVENT_DEVICE_CONNECTED:14191419+ icm->device_connected(tb, n->pkg);14201420+ break;14211421+ case ICM_EVENT_DEVICE_DISCONNECTED:14221422+ icm->device_disconnected(tb, n->pkg);14231423+ break;14241424+ case ICM_EVENT_XDOMAIN_CONNECTED:14251425+ icm->xdomain_connected(tb, n->pkg);14261426+ break;14271427+ case ICM_EVENT_XDOMAIN_DISCONNECTED:14281428+ icm->xdomain_disconnected(tb, n->pkg);14291429+ break;14301430+ }14081431 }1409143214101433 mutex_unlock(&tb->lock);
···630630 if (!data->skip_autocfg)631631 dw8250_setup_port(p);632632633633-#ifdef CONFIG_PM634634- uart.capabilities |= UART_CAP_RPM;635635-#endif636636-637633 /* If we have a valid fifosize, try hooking up DMA */638634 if (p->fifosize) {639635 data->dma.rxconf.src_maxburst = p->fifosize / 4;
···15141514{15151515 struct acm *acm = usb_get_intfdata(intf);15161516 struct tty_struct *tty;15171517+ int i;1517151815181519 /* sibling interface is already cleaning up */15191520 if (!acm)···1545154415461545 tty_unregister_device(acm_tty_driver, acm->minor);1547154615471547+ usb_free_urb(acm->ctrlurb);15481548+ for (i = 0; i < ACM_NW; i++)15491549+ usb_free_urb(acm->wb[i].urb);15501550+ for (i = 0; i < acm->rx_buflimit; i++)15511551+ usb_free_urb(acm->read_urbs[i]);15481552 acm_write_buffers_free(acm);15491553 usb_free_coherent(acm->dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);15501554 acm_read_buffers_free(acm);
···244244 seqlock_t cells_lock;245245246246 struct mutex proc_cells_lock;247247- struct list_head proc_cells;247247+ struct hlist_head proc_cells;248248249249 /* Known servers. Theoretically each fileserver can only be in one250250 * cell, but in practice, people create aliases and subsets and there's···322322 struct afs_net *net;323323 struct key *anonymous_key; /* anonymous user key for this cell */324324 struct work_struct manager; /* Manager for init/deinit/dns */325325- struct list_head proc_link; /* /proc cell list link */325325+ struct hlist_node proc_link; /* /proc cell list link */326326#ifdef CONFIG_AFS_FSCACHE327327 struct fscache_cookie *cache; /* caching cookie */328328#endif
···12201220 return 0;12211221}1222122212231223+/* Unlock both inodes after they've been prepped for a range clone. */12241224+STATIC void12251225+xfs_reflink_remap_unlock(12261226+ struct file *file_in,12271227+ struct file *file_out)12281228+{12291229+ struct inode *inode_in = file_inode(file_in);12301230+ struct xfs_inode *src = XFS_I(inode_in);12311231+ struct inode *inode_out = file_inode(file_out);12321232+ struct xfs_inode *dest = XFS_I(inode_out);12331233+ bool same_inode = (inode_in == inode_out);12341234+12351235+ xfs_iunlock(dest, XFS_MMAPLOCK_EXCL);12361236+ if (!same_inode)12371237+ xfs_iunlock(src, XFS_MMAPLOCK_SHARED);12381238+ inode_unlock(inode_out);12391239+ if (!same_inode)12401240+ inode_unlock_shared(inode_in);12411241+}12421242+12231243/*12241224- * Link a range of blocks from one file to another.12441244+ * If we're reflinking to a point past the destination file's EOF, we must12451245+ * zero any speculative post-EOF preallocations that sit between the old EOF12461246+ * and the destination file offset.12251247 */12261226-int12271227-xfs_reflink_remap_range(12481248+static int12491249+xfs_reflink_zero_posteof(12501250+ struct xfs_inode *ip,12511251+ loff_t pos)12521252+{12531253+ loff_t isize = i_size_read(VFS_I(ip));12541254+12551255+ if (pos <= isize)12561256+ return 0;12571257+12581258+ trace_xfs_zero_eof(ip, isize, pos - isize);12591259+ return iomap_zero_range(VFS_I(ip), isize, pos - isize, NULL,12601260+ &xfs_iomap_ops);12611261+}12621262+12631263+/*12641264+ * Prepare two files for range cloning. Upon a successful return both inodes12651265+ * will have the iolock and mmaplock held, the page cache of the out file will12661266+ * be truncated, and any leases on the out file will have been broken. This12671267+ * function borrows heavily from xfs_file_aio_write_checks.12681268+ *12691269+ * The VFS allows partial EOF blocks to "match" for dedupe even though it hasn't12701270+ * checked that the bytes beyond EOF physically match. Hence we cannot use the12711271+ * EOF block in the source dedupe range because it's not a complete block match,12721272+ * hence can introduce a corruption into the file that has it's block replaced.12731273+ *12741274+ * In similar fashion, the VFS file cloning also allows partial EOF blocks to be12751275+ * "block aligned" for the purposes of cloning entire files. However, if the12761276+ * source file range includes the EOF block and it lands within the existing EOF12771277+ * of the destination file, then we can expose stale data from beyond the source12781278+ * file EOF in the destination file.12791279+ *12801280+ * XFS doesn't support partial block sharing, so in both cases we have check12811281+ * these cases ourselves. For dedupe, we can simply round the length to dedupe12821282+ * down to the previous whole block and ignore the partial EOF block. While this12831283+ * means we can't dedupe the last block of a file, this is an acceptible12841284+ * tradeoff for simplicity on implementation.12851285+ *12861286+ * For cloning, we want to share the partial EOF block if it is also the new EOF12871287+ * block of the destination file. If the partial EOF block lies inside the12881288+ * existing destination EOF, then we have to abort the clone to avoid exposing12891289+ * stale data in the destination file. Hence we reject these clone attempts with12901290+ * -EINVAL in this case.12911291+ */12921292+STATIC int12931293+xfs_reflink_remap_prep(12281294 struct file *file_in,12291295 loff_t pos_in,12301296 struct file *file_out,12311297 loff_t pos_out,12321232- u64 len,12981298+ u64 *len,12331299 bool is_dedupe)12341300{12351301 struct inode *inode_in = file_inode(file_in);12361302 struct xfs_inode *src = XFS_I(inode_in);12371303 struct inode *inode_out = file_inode(file_out);12381304 struct xfs_inode *dest = XFS_I(inode_out);12391239- struct xfs_mount *mp = src->i_mount;12401305 bool same_inode = (inode_in == inode_out);12411241- xfs_fileoff_t sfsbno, dfsbno;12421242- xfs_filblks_t fsblen;12431243- xfs_extlen_t cowextsize;13061306+ u64 blkmask = i_blocksize(inode_in) - 1;12441307 ssize_t ret;12451245-12461246- if (!xfs_sb_version_hasreflink(&mp->m_sb))12471247- return -EOPNOTSUPP;12481248-12491249- if (XFS_FORCED_SHUTDOWN(mp))12501250- return -EIO;1251130812521309 /* Lock both files against IO */12531310 ret = xfs_iolock_two_inodes_and_break_layout(inode_in, inode_out);···13271270 goto out_unlock;1328127113291272 ret = vfs_clone_file_prep_inodes(inode_in, pos_in, inode_out, pos_out,13301330- &len, is_dedupe);12731273+ len, is_dedupe);13311274 if (ret <= 0)13321275 goto out_unlock;12761276+12771277+ /*12781278+ * If the dedupe data matches, chop off the partial EOF block12791279+ * from the source file so we don't try to dedupe the partial12801280+ * EOF block.12811281+ */12821282+ if (is_dedupe) {12831283+ *len &= ~blkmask;12841284+ } else if (*len & blkmask) {12851285+ /*12861286+ * The user is attempting to share a partial EOF block,12871287+ * if it's inside the destination EOF then reject it.12881288+ */12891289+ if (pos_out + *len < i_size_read(inode_out)) {12901290+ ret = -EINVAL;12911291+ goto out_unlock;12921292+ }12931293+ }1333129413341295 /* Attach dquots to dest inode before changing block map */13351296 ret = xfs_qm_dqattach(dest);13361297 if (ret)13371298 goto out_unlock;1338129913391339- trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);13401340-13411300 /*13421342- * Clear out post-eof preallocations because we don't have page cache13431343- * backing the delayed allocations and they'll never get freed on13441344- * their own.13011301+ * Zero existing post-eof speculative preallocations in the destination13021302+ * file.13451303 */13461346- if (xfs_can_free_eofblocks(dest, true)) {13471347- ret = xfs_free_eofblocks(dest);13481348- if (ret)13491349- goto out_unlock;13501350- }13041304+ ret = xfs_reflink_zero_posteof(dest, pos_out);13051305+ if (ret)13061306+ goto out_unlock;1351130713521308 /* Set flags and remap blocks. */13531309 ret = xfs_reflink_set_inode_flag(src, dest);13541310 if (ret)13551311 goto out_unlock;13121312+13131313+ /* Zap any page cache for the destination file's range. */13141314+ truncate_inode_pages_range(&inode_out->i_data, pos_out,13151315+ PAGE_ALIGN(pos_out + *len) - 1);13161316+13171317+ /* If we're altering the file contents... */13181318+ if (!is_dedupe) {13191319+ /*13201320+ * ...update the timestamps (which will grab the ilock again13211321+ * from xfs_fs_dirty_inode, so we have to call it before we13221322+ * take the ilock).13231323+ */13241324+ if (!(file_out->f_mode & FMODE_NOCMTIME)) {13251325+ ret = file_update_time(file_out);13261326+ if (ret)13271327+ goto out_unlock;13281328+ }13291329+13301330+ /*13311331+ * ...clear the security bits if the process is not being run13321332+ * by root. This keeps people from modifying setuid and setgid13331333+ * binaries.13341334+ */13351335+ ret = file_remove_privs(file_out);13361336+ if (ret)13371337+ goto out_unlock;13381338+ }13391339+13401340+ return 1;13411341+out_unlock:13421342+ xfs_reflink_remap_unlock(file_in, file_out);13431343+ return ret;13441344+}13451345+13461346+/*13471347+ * Link a range of blocks from one file to another.13481348+ */13491349+int13501350+xfs_reflink_remap_range(13511351+ struct file *file_in,13521352+ loff_t pos_in,13531353+ struct file *file_out,13541354+ loff_t pos_out,13551355+ u64 len,13561356+ bool is_dedupe)13571357+{13581358+ struct inode *inode_in = file_inode(file_in);13591359+ struct xfs_inode *src = XFS_I(inode_in);13601360+ struct inode *inode_out = file_inode(file_out);13611361+ struct xfs_inode *dest = XFS_I(inode_out);13621362+ struct xfs_mount *mp = src->i_mount;13631363+ xfs_fileoff_t sfsbno, dfsbno;13641364+ xfs_filblks_t fsblen;13651365+ xfs_extlen_t cowextsize;13661366+ ssize_t ret;13671367+13681368+ if (!xfs_sb_version_hasreflink(&mp->m_sb))13691369+ return -EOPNOTSUPP;13701370+13711371+ if (XFS_FORCED_SHUTDOWN(mp))13721372+ return -EIO;13731373+13741374+ /* Prepare and then clone file data. */13751375+ ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out,13761376+ &len, is_dedupe);13771377+ if (ret <= 0)13781378+ return ret;13791379+13801380+ trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);1356138113571382 dfsbno = XFS_B_TO_FSBT(mp, pos_out);13581383 sfsbno = XFS_B_TO_FSBT(mp, pos_in);···14431304 pos_out + len);14441305 if (ret)14451306 goto out_unlock;14461446-14471447- /* Zap any page cache for the destination file's range. */14481448- truncate_inode_pages_range(&inode_out->i_data, pos_out,14491449- PAGE_ALIGN(pos_out + len) - 1);1450130714511308 /*14521309 * Carry the cowextsize hint from src to dest if we're sharing the···14601325 is_dedupe);1461132614621327out_unlock:14631463- xfs_iunlock(dest, XFS_MMAPLOCK_EXCL);14641464- if (!same_inode)14651465- xfs_iunlock(src, XFS_MMAPLOCK_SHARED);14661466- inode_unlock(inode_out);14671467- if (!same_inode)14681468- inode_unlock_shared(inode_in);13281328+ xfs_reflink_remap_unlock(file_in, file_out);14691329 if (ret)14701330 trace_xfs_reflink_remap_range_error(dest, ret, _RET_IP_);14711331 return ret;
···412412 * specific task are charged to the dom_cgrp.413413 */414414 struct cgroup *dom_cgrp;415415+ struct cgroup *old_dom_cgrp; /* used while enabling threaded */415416416417 /* per-cpu recursive resource statistics */417418 struct cgroup_rstat_cpu __percpu *rstat_cpu;
+14-6
include/linux/fpga/fpga-mgr.h
···5353 FPGA_MGR_STATE_OPERATING,5454};55555656-/*5757- * FPGA Manager flags5858- * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported5959- * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting6060- * FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first6161- * FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed5656+/**5757+ * DOC: FPGA Manager flags5858+ *5959+ * Flags used in the &fpga_image_info->flags field6060+ *6161+ * %FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported6262+ *6363+ * %FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting6464+ *6565+ * %FPGA_MGR_ENCRYPTED_BITSTREAM: indicates bitstream is encrypted6666+ *6767+ * %FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first6868+ *6969+ * %FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed6270 */6371#define FPGA_MGR_PARTIAL_RECONFIG BIT(0)6472#define FPGA_MGR_EXTERNAL_CONFIG BIT(1)
+7
include/linux/gpio/driver.h
···9595 unsigned int num_parents;96969797 /**9898+ * @parent_irq:9999+ *100100+ * For use by gpiochip_set_cascaded_irqchip()101101+ */102102+ unsigned int parent_irq;103103+104104+ /**98105 * @parents:99106 *100107 * A list of interrupt parents of a GPIO chip. This is owned by the
-4
include/linux/mmzone.h
···668668 wait_queue_head_t kcompactd_wait;669669 struct task_struct *kcompactd;670670#endif671671-#ifdef CONFIG_NUMA_BALANCING672672- /* Lock serializing the migrate rate limiting window */673673- spinlock_t numabalancing_migrate_lock;674674-#endif675671 /*676672 * This is a per-node reserve of pages that are not available677673 * to userspace allocations.
+7
include/linux/netdevice.h
···24962496 struct netlink_ext_ack *extack;24972497};2498249824992499+struct netdev_notifier_info_ext {25002500+ struct netdev_notifier_info info; /* must be first */25012501+ union {25022502+ u32 mtu;25032503+ } ext;25042504+};25052505+24992506struct netdev_notifier_change_info {25002507 struct netdev_notifier_info info; /* must be first */25012508 unsigned int flags_changed;
···126126 */127127int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num);128128129129+/**130130+ * bman_is_probed - Check if bman is probed131131+ *132132+ * Returns 1 if the bman driver successfully probed, -1 if the bman driver133133+ * failed to probe or 0 if the bman driver did not probed yet.134134+ */135135+int bman_is_probed(void);136136+129137#endif /* __FSL_BMAN_H */
+8
include/soc/fsl/qman.h
···11861186 */11871187int qman_release_cgrid(u32 id);1188118811891189+/**11901190+ * qman_is_probed - Check if qman is probed11911191+ *11921192+ * Returns 1 if the qman driver successfully probed, -1 if the qman driver11931193+ * failed to probe or 0 if the qman driver did not probed yet.11941194+ */11951195+int qman_is_probed(void);11961196+11891197#endif /* __FSL_QMAN_H */
···1515 * but they are bigger and use more memory for the lookup table.1616 */17171818-#include <linux/crc32poly.h>1918#include "xz_private.h"20192120/*
+4
lib/xz/xz_private.h
···102102# endif103103#endif104104105105+#ifndef CRC32_POLY_LE106106+#define CRC32_POLY_LE 0xedb88320107107+#endif108108+105109/*106110 * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used107111 * before calling xz_dec_lzma2_run().
···12911291static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)12921292{12931293 struct net_device *dev = netdev_notifier_info_to_dev(ptr);12941294- struct netdev_notifier_changeupper_info *info;12941294+ struct netdev_notifier_changeupper_info *upper_info = ptr;12951295+ struct netdev_notifier_info_ext *info_ext = ptr;12951296 struct in_device *in_dev;12961297 struct net *net = dev_net(dev);12971298 unsigned int flags;···13271326 fib_sync_up(dev, RTNH_F_LINKDOWN);13281327 else13291328 fib_sync_down_dev(dev, event, false);13301330- /* fall through */13291329+ rt_cache_flush(net);13301330+ break;13311331 case NETDEV_CHANGEMTU:13321332+ fib_sync_mtu(dev, info_ext->ext.mtu);13321333 rt_cache_flush(net);13331334 break;13341335 case NETDEV_CHANGEUPPER:13351335- info = ptr;13361336+ upper_info = ptr;13361337 /* flush all routes if dev is linked to or unlinked from13371338 * an L3 master device (e.g., VRF)13381339 */13391339- if (info->upper_dev && netif_is_l3_master(info->upper_dev))13401340+ if (upper_info->upper_dev &&13411341+ netif_is_l3_master(upper_info->upper_dev))13401342 fib_disable_ip(dev, NETDEV_DOWN, true);13411343 break;13421344 }
+50
net/ipv4/fib_semantics.c
···14571457 return NOTIFY_DONE;14581458}1459145914601460+/* Update the PMTU of exceptions when:14611461+ * - the new MTU of the first hop becomes smaller than the PMTU14621462+ * - the old MTU was the same as the PMTU, and it limited discovery of14631463+ * larger MTUs on the path. With that limit raised, we can now14641464+ * discover larger MTUs14651465+ * A special case is locked exceptions, for which the PMTU is smaller14661466+ * than the minimal accepted PMTU:14671467+ * - if the new MTU is greater than the PMTU, don't make any change14681468+ * - otherwise, unlock and set PMTU14691469+ */14701470+static void nh_update_mtu(struct fib_nh *nh, u32 new, u32 orig)14711471+{14721472+ struct fnhe_hash_bucket *bucket;14731473+ int i;14741474+14751475+ bucket = rcu_dereference_protected(nh->nh_exceptions, 1);14761476+ if (!bucket)14771477+ return;14781478+14791479+ for (i = 0; i < FNHE_HASH_SIZE; i++) {14801480+ struct fib_nh_exception *fnhe;14811481+14821482+ for (fnhe = rcu_dereference_protected(bucket[i].chain, 1);14831483+ fnhe;14841484+ fnhe = rcu_dereference_protected(fnhe->fnhe_next, 1)) {14851485+ if (fnhe->fnhe_mtu_locked) {14861486+ if (new <= fnhe->fnhe_pmtu) {14871487+ fnhe->fnhe_pmtu = new;14881488+ fnhe->fnhe_mtu_locked = false;14891489+ }14901490+ } else if (new < fnhe->fnhe_pmtu ||14911491+ orig == fnhe->fnhe_pmtu) {14921492+ fnhe->fnhe_pmtu = new;14931493+ }14941494+ }14951495+ }14961496+}14971497+14981498+void fib_sync_mtu(struct net_device *dev, u32 orig_mtu)14991499+{15001500+ unsigned int hash = fib_devindex_hashfn(dev->ifindex);15011501+ struct hlist_head *head = &fib_info_devhash[hash];15021502+ struct fib_nh *nh;15031503+15041504+ hlist_for_each_entry(nh, head, nh_hash) {15051505+ if (nh->nh_dev == dev)15061506+ nh_update_mtu(nh, dev->mtu, orig_mtu);15071507+ }15081508+}15091509+14601510/* Event force Flags Description14611511 * NETDEV_CHANGE 0 LINKDOWN Carrier OFF, not for scope host14621512 * NETDEV_DOWN 0 LINKDOWN|DEAD Link down, not for scope host
+4-3
net/ipv4/route.c
···10011001static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)10021002{10031003 struct dst_entry *dst = &rt->dst;10041004+ u32 old_mtu = ipv4_mtu(dst);10041005 struct fib_result res;10051006 bool lock = false;1006100710071008 if (ip_mtu_locked(dst))10081009 return;1009101010101010- if (ipv4_mtu(dst) < mtu)10111011+ if (old_mtu < mtu)10111012 return;1012101310131014 if (mtu < ip_rt_min_pmtu) {10141015 lock = true;10151015- mtu = ip_rt_min_pmtu;10161016+ mtu = min(old_mtu, ip_rt_min_pmtu);10161017 }1017101810181018- if (rt->rt_pmtu == mtu &&10191019+ if (rt->rt_pmtu == mtu && !lock &&10191020 time_before(jiffies, dst->expires - ip_rt_mtu_expires / 2))10201021 return;10211022
···10071007 return ret;10081008}1009100910101010-static int rds_send_mprds_hash(struct rds_sock *rs, struct rds_connection *conn)10101010+static int rds_send_mprds_hash(struct rds_sock *rs,10111011+ struct rds_connection *conn, int nonblock)10111012{10121013 int hash;10131014···10241023 * used. But if we are interrupted, we have to use the zero10251024 * c_path in case the connection ends up being non-MP capable.10261025 */10271027- if (conn->c_npaths == 0)10261026+ if (conn->c_npaths == 0) {10271027+ /* Cannot wait for the connection be made, so just use10281028+ * the base c_path.10291029+ */10301030+ if (nonblock)10311031+ return 0;10281032 if (wait_event_interruptible(conn->c_hs_waitq,10291033 conn->c_npaths != 0))10301034 hash = 0;10351035+ }10311036 if (conn->c_npaths == 1)10321037 hash = 0;10331038 }···12631256 }1264125712651258 if (conn->c_trans->t_mp_capable)12661266- cpath = &conn->c_path[rds_send_mprds_hash(rs, conn)];12591259+ cpath = &conn->c_path[rds_send_mprds_hash(rs, conn, nonblock)];12671260 else12681261 cpath = &conn->c_path[0];12691262
+13-10
net/rxrpc/ar-internal.h
···302302303303 /* calculated RTT cache */304304#define RXRPC_RTT_CACHE_SIZE 32305305+ spinlock_t rtt_input_lock; /* RTT lock for input routine */305306 ktime_t rtt_last_req; /* Time of last RTT request */306307 u64 rtt; /* Current RTT estimate (in nS) */307308 u64 rtt_sum; /* Sum of cache contents */···443442 spinlock_t state_lock; /* state-change lock */444443 enum rxrpc_conn_cache_state cache_state;445444 enum rxrpc_conn_proto_state state; /* current state of connection */446446- u32 local_abort; /* local abort code */447447- u32 remote_abort; /* remote abort code */445445+ u32 abort_code; /* Abort code of connection abort */448446 int debug_id; /* debug ID for printks */449447 atomic_t serial; /* packet serial number counter */450448 unsigned int hi_serial; /* highest serial number received */451449 u32 security_nonce; /* response re-use preventer */452452- u16 service_id; /* Service ID, possibly upgraded */450450+ u32 service_id; /* Service ID, possibly upgraded */453451 u8 size_align; /* data size alignment (for security) */454452 u8 security_size; /* security header size */455453 u8 security_ix; /* security type */456454 u8 out_clientflag; /* RXRPC_CLIENT_INITIATED if we are client */455455+ short error; /* Local error code */457456};458457459458static inline bool rxrpc_to_server(const struct rxrpc_skb_priv *sp)···636635 bool tx_phase; /* T if transmission phase, F if receive phase */637636 u8 nr_jumbo_bad; /* Number of jumbo dups/exceeds-windows */638637638638+ spinlock_t input_lock; /* Lock for packet input to this call */639639+639640 /* receive-phase ACK management */640641 u8 ackr_reason; /* reason to ACK */641642 u16 ackr_skew; /* skew on packet being ACK'd */···723720void rxrpc_discard_prealloc(struct rxrpc_sock *);724721struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *,725722 struct rxrpc_sock *,726726- struct rxrpc_peer *,727727- struct rxrpc_connection *,728723 struct sk_buff *);729724void rxrpc_accept_incoming_calls(struct rxrpc_local *);730725struct rxrpc_call *rxrpc_accept_call(struct rxrpc_sock *, unsigned long,···892891extern struct idr rxrpc_client_conn_ids;893892894893void rxrpc_destroy_client_conn_ids(void);895895-int rxrpc_connect_call(struct rxrpc_call *, struct rxrpc_conn_parameters *,896896- struct sockaddr_rxrpc *, gfp_t);894894+int rxrpc_connect_call(struct rxrpc_sock *, struct rxrpc_call *,895895+ struct rxrpc_conn_parameters *, struct sockaddr_rxrpc *,896896+ gfp_t);897897void rxrpc_expose_client_call(struct rxrpc_call *);898898void rxrpc_disconnect_client_call(struct rxrpc_call *);899899void rxrpc_put_client_conn(struct rxrpc_connection *);···967965/*968966 * input.c969967 */970970-void rxrpc_data_ready(struct sock *);968968+int rxrpc_input_packet(struct sock *, struct sk_buff *);971969972970/*973971 * insecure.c···10471045 */10481046struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *,10491047 const struct sockaddr_rxrpc *);10501050-struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_local *,10481048+struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_sock *, struct rxrpc_local *,10511049 struct sockaddr_rxrpc *, gfp_t);10521050struct rxrpc_peer *rxrpc_alloc_peer(struct rxrpc_local *, gfp_t);10531053-void rxrpc_new_incoming_peer(struct rxrpc_local *, struct rxrpc_peer *);10511051+void rxrpc_new_incoming_peer(struct rxrpc_sock *, struct rxrpc_local *,10521052+ struct rxrpc_peer *);10541053void rxrpc_destroy_all_peers(struct rxrpc_net *);10551054struct rxrpc_peer *rxrpc_get_peer(struct rxrpc_peer *);10561055struct rxrpc_peer *rxrpc_get_peer_maybe(struct rxrpc_peer *);
+18-9
net/rxrpc/call_accept.c
···287287 (peer_tail + 1) &288288 (RXRPC_BACKLOG_MAX - 1));289289290290- rxrpc_new_incoming_peer(local, peer);290290+ rxrpc_new_incoming_peer(rx, local, peer);291291 }292292293293 /* Now allocate and set up the connection */···333333 */334334struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,335335 struct rxrpc_sock *rx,336336- struct rxrpc_peer *peer,337337- struct rxrpc_connection *conn,338336 struct sk_buff *skb)339337{340338 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);339339+ struct rxrpc_connection *conn;340340+ struct rxrpc_peer *peer;341341 struct rxrpc_call *call;342342343343 _enter("");···353353 call = NULL;354354 goto out;355355 }356356+357357+ /* The peer, connection and call may all have sprung into existence due358358+ * to a duplicate packet being handled on another CPU in parallel, so359359+ * we have to recheck the routing. However, we're now holding360360+ * rx->incoming_lock, so the values should remain stable.361361+ */362362+ conn = rxrpc_find_connection_rcu(local, skb, &peer);356363357364 call = rxrpc_alloc_incoming_call(rx, local, peer, conn, skb);358365 if (!call) {···403396404397 case RXRPC_CONN_SERVICE:405398 write_lock(&call->state_lock);406406- if (rx->discard_new_call)407407- call->state = RXRPC_CALL_SERVER_RECV_REQUEST;408408- else409409- call->state = RXRPC_CALL_SERVER_ACCEPTING;399399+ if (call->state < RXRPC_CALL_COMPLETE) {400400+ if (rx->discard_new_call)401401+ call->state = RXRPC_CALL_SERVER_RECV_REQUEST;402402+ else403403+ call->state = RXRPC_CALL_SERVER_ACCEPTING;404404+ }410405 write_unlock(&call->state_lock);411406 break;412407413408 case RXRPC_CONN_REMOTELY_ABORTED:414409 rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED,415415- conn->remote_abort, -ECONNABORTED);410410+ conn->abort_code, conn->error);416411 break;417412 case RXRPC_CONN_LOCALLY_ABORTED:418413 rxrpc_abort_call("CON", call, sp->hdr.seq,419419- conn->local_abort, -ECONNABORTED);414414+ conn->abort_code, conn->error);420415 break;421416 default:422417 BUG();
+3-2
net/rxrpc/call_object.c
···138138 init_waitqueue_head(&call->waitq);139139 spin_lock_init(&call->lock);140140 spin_lock_init(&call->notify_lock);141141+ spin_lock_init(&call->input_lock);141142 rwlock_init(&call->state_lock);142143 atomic_set(&call->usage, 1);143144 call->debug_id = debug_id;···288287 /* Set up or get a connection record and set the protocol parameters,289288 * including channel number and call ID.290289 */291291- ret = rxrpc_connect_call(call, cp, srx, gfp);290290+ ret = rxrpc_connect_call(rx, call, cp, srx, gfp);292291 if (ret < 0)293292 goto error;294293···340339 /* Set up or get a connection record and set the protocol parameters,341340 * including channel number and call ID.342341 */343343- ret = rxrpc_connect_call(call, cp, srx, gfp);342342+ ret = rxrpc_connect_call(rx, call, cp, srx, gfp);344343 if (ret < 0)345344 goto error;346345
+6-4
net/rxrpc/conn_client.c
···276276 * If we return with a connection, the call will be on its waiting list. It's277277 * left to the caller to assign a channel and wake up the call.278278 */279279-static int rxrpc_get_client_conn(struct rxrpc_call *call,279279+static int rxrpc_get_client_conn(struct rxrpc_sock *rx,280280+ struct rxrpc_call *call,280281 struct rxrpc_conn_parameters *cp,281282 struct sockaddr_rxrpc *srx,282283 gfp_t gfp)···290289291290 _enter("{%d,%lx},", call->debug_id, call->user_call_ID);292291293293- cp->peer = rxrpc_lookup_peer(cp->local, srx, gfp);292292+ cp->peer = rxrpc_lookup_peer(rx, cp->local, srx, gfp);294293 if (!cp->peer)295294 goto error;296295···684683 * find a connection for a call685684 * - called in process context with IRQs enabled686685 */687687-int rxrpc_connect_call(struct rxrpc_call *call,686686+int rxrpc_connect_call(struct rxrpc_sock *rx,687687+ struct rxrpc_call *call,688688 struct rxrpc_conn_parameters *cp,689689 struct sockaddr_rxrpc *srx,690690 gfp_t gfp)···698696 rxrpc_discard_expired_client_conns(&rxnet->client_conn_reaper);699697 rxrpc_cull_active_client_conns(rxnet);700698701701- ret = rxrpc_get_client_conn(call, cp, srx, gfp);699699+ ret = rxrpc_get_client_conn(rx, call, cp, srx, gfp);702700 if (ret < 0)703701 goto out;704702
···216216/*217217 * Apply a hard ACK by advancing the Tx window.218218 */219219-static void rxrpc_rotate_tx_window(struct rxrpc_call *call, rxrpc_seq_t to,219219+static bool rxrpc_rotate_tx_window(struct rxrpc_call *call, rxrpc_seq_t to,220220 struct rxrpc_ack_summary *summary)221221{222222 struct sk_buff *skb, *list = NULL;223223+ bool rot_last = false;223224 int ix;224225 u8 annotation;225226···244243 skb->next = list;245244 list = skb;246245247247- if (annotation & RXRPC_TX_ANNO_LAST)246246+ if (annotation & RXRPC_TX_ANNO_LAST) {248247 set_bit(RXRPC_CALL_TX_LAST, &call->flags);248248+ rot_last = true;249249+ }249250 if ((annotation & RXRPC_TX_ANNO_MASK) != RXRPC_TX_ANNO_ACK)250251 summary->nr_rot_new_acks++;251252 }252253253254 spin_unlock(&call->lock);254255255255- trace_rxrpc_transmit(call, (test_bit(RXRPC_CALL_TX_LAST, &call->flags) ?256256+ trace_rxrpc_transmit(call, (rot_last ?256257 rxrpc_transmit_rotate_last :257258 rxrpc_transmit_rotate));258259 wake_up(&call->waitq);···265262 skb_mark_not_on_list(skb);266263 rxrpc_free_skb(skb, rxrpc_skb_tx_freed);267264 }265265+266266+ return rot_last;268267}269268270269/*···278273static bool rxrpc_end_tx_phase(struct rxrpc_call *call, bool reply_begun,279274 const char *abort_why)280275{276276+ unsigned int state;281277282278 ASSERT(test_bit(RXRPC_CALL_TX_LAST, &call->flags));283279284280 write_lock(&call->state_lock);285281286286- switch (call->state) {282282+ state = call->state;283283+ switch (state) {287284 case RXRPC_CALL_CLIENT_SEND_REQUEST:288285 case RXRPC_CALL_CLIENT_AWAIT_REPLY:289286 if (reply_begun)290290- call->state = RXRPC_CALL_CLIENT_RECV_REPLY;287287+ call->state = state = RXRPC_CALL_CLIENT_RECV_REPLY;291288 else292292- call->state = RXRPC_CALL_CLIENT_AWAIT_REPLY;289289+ call->state = state = RXRPC_CALL_CLIENT_AWAIT_REPLY;293290 break;294291295292 case RXRPC_CALL_SERVER_AWAIT_ACK:296293 __rxrpc_call_completed(call);297294 rxrpc_notify_socket(call);295295+ state = call->state;298296 break;299297300298 default:···305297 }306298307299 write_unlock(&call->state_lock);308308- if (call->state == RXRPC_CALL_CLIENT_AWAIT_REPLY) {300300+ if (state == RXRPC_CALL_CLIENT_AWAIT_REPLY)309301 trace_rxrpc_transmit(call, rxrpc_transmit_await_reply);310310- } else {302302+ else311303 trace_rxrpc_transmit(call, rxrpc_transmit_end);312312- }313304 _leave(" = ok");314305 return true;315306···339332 trace_rxrpc_timer(call, rxrpc_timer_init_for_reply, now);340333 }341334342342- if (!test_bit(RXRPC_CALL_TX_LAST, &call->flags))343343- rxrpc_rotate_tx_window(call, top, &summary);344335 if (!test_bit(RXRPC_CALL_TX_LAST, &call->flags)) {345345- rxrpc_proto_abort("TXL", call, top);346346- return false;336336+ if (!rxrpc_rotate_tx_window(call, top, &summary)) {337337+ rxrpc_proto_abort("TXL", call, top);338338+ return false;339339+ }347340 }348341 if (!rxrpc_end_tx_phase(call, true, "ETD"))349342 return false;···459452 }460453 }461454455455+ spin_lock(&call->input_lock);456456+462457 /* Received data implicitly ACKs all of the request packets we sent463458 * when we're acting as a client.464459 */465460 if ((state == RXRPC_CALL_CLIENT_SEND_REQUEST ||466461 state == RXRPC_CALL_CLIENT_AWAIT_REPLY) &&467462 !rxrpc_receiving_reply(call))468468- return;463463+ goto unlock;469464470465 call->ackr_prev_seq = seq;471466···497488498489 if (flags & RXRPC_LAST_PACKET) {499490 if (test_bit(RXRPC_CALL_RX_LAST, &call->flags) &&500500- seq != call->rx_top)501501- return rxrpc_proto_abort("LSN", call, seq);491491+ seq != call->rx_top) {492492+ rxrpc_proto_abort("LSN", call, seq);493493+ goto unlock;494494+ }502495 } else {503496 if (test_bit(RXRPC_CALL_RX_LAST, &call->flags) &&504504- after_eq(seq, call->rx_top))505505- return rxrpc_proto_abort("LSA", call, seq);497497+ after_eq(seq, call->rx_top)) {498498+ rxrpc_proto_abort("LSA", call, seq);499499+ goto unlock;500500+ }506501 }507502508503 trace_rxrpc_rx_data(call->debug_id, seq, serial, flags, annotation);···573560skip:574561 offset += len;575562 if (flags & RXRPC_JUMBO_PACKET) {576576- if (skb_copy_bits(skb, offset, &flags, 1) < 0)577577- return rxrpc_proto_abort("XJF", call, seq);563563+ if (skb_copy_bits(skb, offset, &flags, 1) < 0) {564564+ rxrpc_proto_abort("XJF", call, seq);565565+ goto unlock;566566+ }578567 offset += sizeof(struct rxrpc_jumbo_header);579568 seq++;580569 serial++;···616601 trace_rxrpc_notify_socket(call->debug_id, serial);617602 rxrpc_notify_socket(call);618603 }604604+605605+unlock:606606+ spin_unlock(&call->input_lock);619607 _leave(" [queued]");620608}621609···705687706688 ping_time = call->ping_time;707689 smp_rmb();708708- ping_serial = call->ping_serial;690690+ ping_serial = READ_ONCE(call->ping_serial);709691710692 if (orig_serial == call->acks_lost_ping)711693 rxrpc_input_check_for_lost_ack(call);712694713713- if (!test_bit(RXRPC_CALL_PINGING, &call->flags) ||714714- before(orig_serial, ping_serial))695695+ if (before(orig_serial, ping_serial) ||696696+ !test_and_clear_bit(RXRPC_CALL_PINGING, &call->flags))715697 return;716716- clear_bit(RXRPC_CALL_PINGING, &call->flags);717698 if (after(orig_serial, ping_serial))718699 return;719700···878861 rxrpc_propose_ack_respond_to_ack);879862 }880863881881- ioffset = offset + nr_acks + 3;882882- if (skb->len >= ioffset + sizeof(buf.info)) {883883- if (skb_copy_bits(skb, ioffset, &buf.info, sizeof(buf.info)) < 0)884884- return rxrpc_proto_abort("XAI", call, 0);885885- rxrpc_input_ackinfo(call, skb, &buf.info);886886- }864864+ /* Discard any out-of-order or duplicate ACKs. */865865+ if (before_eq(sp->hdr.serial, call->acks_latest))866866+ return;887867888888- if (first_soft_ack == 0)889889- return rxrpc_proto_abort("AK0", call, 0);868868+ buf.info.rxMTU = 0;869869+ ioffset = offset + nr_acks + 3;870870+ if (skb->len >= ioffset + sizeof(buf.info) &&871871+ skb_copy_bits(skb, ioffset, &buf.info, sizeof(buf.info)) < 0)872872+ return rxrpc_proto_abort("XAI", call, 0);873873+874874+ spin_lock(&call->input_lock);875875+876876+ /* Discard any out-of-order or duplicate ACKs. */877877+ if (before_eq(sp->hdr.serial, call->acks_latest))878878+ goto out;879879+ call->acks_latest_ts = skb->tstamp;880880+ call->acks_latest = sp->hdr.serial;881881+882882+ /* Parse rwind and mtu sizes if provided. */883883+ if (buf.info.rxMTU)884884+ rxrpc_input_ackinfo(call, skb, &buf.info);885885+886886+ if (first_soft_ack == 0) {887887+ rxrpc_proto_abort("AK0", call, 0);888888+ goto out;889889+ }890890891891 /* Ignore ACKs unless we are or have just been transmitting. */892892 switch (READ_ONCE(call->state)) {···913879 case RXRPC_CALL_SERVER_AWAIT_ACK:914880 break;915881 default:916916- return;882882+ goto out;917883 }918918-919919- /* Discard any out-of-order or duplicate ACKs. */920920- if (before_eq(sp->hdr.serial, call->acks_latest)) {921921- _debug("discard ACK %d <= %d",922922- sp->hdr.serial, call->acks_latest);923923- return;924924- }925925- call->acks_latest_ts = skb->tstamp;926926- call->acks_latest = sp->hdr.serial;927884928885 if (before(hard_ack, call->tx_hard_ack) ||929929- after(hard_ack, call->tx_top))930930- return rxrpc_proto_abort("AKW", call, 0);931931- if (nr_acks > call->tx_top - hard_ack)932932- return rxrpc_proto_abort("AKN", call, 0);933933-934934- if (after(hard_ack, call->tx_hard_ack))935935- rxrpc_rotate_tx_window(call, hard_ack, &summary);936936-937937- if (nr_acks > 0) {938938- if (skb_copy_bits(skb, offset, buf.acks, nr_acks) < 0)939939- return rxrpc_proto_abort("XSA", call, 0);940940- rxrpc_input_soft_acks(call, buf.acks, first_soft_ack, nr_acks,941941- &summary);886886+ after(hard_ack, call->tx_top)) {887887+ rxrpc_proto_abort("AKW", call, 0);888888+ goto out;889889+ }890890+ if (nr_acks > call->tx_top - hard_ack) {891891+ rxrpc_proto_abort("AKN", call, 0);892892+ goto out;942893 }943894944944- if (test_bit(RXRPC_CALL_TX_LAST, &call->flags)) {945945- rxrpc_end_tx_phase(call, false, "ETA");946946- return;895895+ if (after(hard_ack, call->tx_hard_ack)) {896896+ if (rxrpc_rotate_tx_window(call, hard_ack, &summary)) {897897+ rxrpc_end_tx_phase(call, false, "ETA");898898+ goto out;899899+ }900900+ }901901+902902+ if (nr_acks > 0) {903903+ if (skb_copy_bits(skb, offset, buf.acks, nr_acks) < 0) {904904+ rxrpc_proto_abort("XSA", call, 0);905905+ goto out;906906+ }907907+ rxrpc_input_soft_acks(call, buf.acks, first_soft_ack, nr_acks,908908+ &summary);947909 }948910949911 if (call->rxtx_annotations[call->tx_top & RXRPC_RXTX_BUFF_MASK] &···950920 false, true,951921 rxrpc_propose_ack_ping_for_lost_reply);952922953953- return rxrpc_congestion_management(call, skb, &summary, acked_serial);923923+ rxrpc_congestion_management(call, skb, &summary, acked_serial);924924+out:925925+ spin_unlock(&call->input_lock);954926}955927956928/*···965933966934 _proto("Rx ACKALL %%%u", sp->hdr.serial);967935968968- rxrpc_rotate_tx_window(call, call->tx_top, &summary);969969- if (test_bit(RXRPC_CALL_TX_LAST, &call->flags))936936+ spin_lock(&call->input_lock);937937+938938+ if (rxrpc_rotate_tx_window(call, call->tx_top, &summary))970939 rxrpc_end_tx_phase(call, false, "ETL");940940+941941+ spin_unlock(&call->input_lock);971942}972943973944/*···10531018}1054101910551020/*10561056- * Handle a new call on a channel implicitly completing the preceding call on10571057- * that channel.10211021+ * Handle a new service call on a channel implicitly completing the preceding10221022+ * call on that channel. This does not apply to client conns.10581023 *10591024 * TODO: If callNumber > call_id + 1, renegotiate security.10601025 */10611061-static void rxrpc_input_implicit_end_call(struct rxrpc_connection *conn,10261026+static void rxrpc_input_implicit_end_call(struct rxrpc_sock *rx,10271027+ struct rxrpc_connection *conn,10621028 struct rxrpc_call *call)10631029{10641030 switch (READ_ONCE(call->state)) {10651031 case RXRPC_CALL_SERVER_AWAIT_ACK:10661032 rxrpc_call_completed(call);10671067- break;10331033+ /* Fall through */10681034 case RXRPC_CALL_COMPLETE:10691035 break;10701036 default:···10731037 set_bit(RXRPC_CALL_EV_ABORT, &call->events);10741038 rxrpc_queue_call(call);10751039 }10401040+ trace_rxrpc_improper_term(call);10761041 break;10771042 }1078104310791079- trace_rxrpc_improper_term(call);10441044+ spin_lock(&rx->incoming_lock);10801045 __rxrpc_disconnect_call(conn, call);10461046+ spin_unlock(&rx->incoming_lock);10811047 rxrpc_notify_socket(call);10821048}10831049···11581120 * The socket is locked by the caller and this prevents the socket from being11591121 * shut down and the local endpoint from going away, thus sk_user_data will not11601122 * be cleared until this function returns.11231123+ *11241124+ * Called with the RCU read lock held from the IP layer via UDP.11611125 */11621162-void rxrpc_data_ready(struct sock *udp_sk)11261126+int rxrpc_input_packet(struct sock *udp_sk, struct sk_buff *skb)11631127{11641128 struct rxrpc_connection *conn;11651129 struct rxrpc_channel *chan;···11701130 struct rxrpc_local *local = udp_sk->sk_user_data;11711131 struct rxrpc_peer *peer = NULL;11721132 struct rxrpc_sock *rx = NULL;11731173- struct sk_buff *skb;11741133 unsigned int channel;11751175- int ret, skew = 0;11341134+ int skew = 0;1176113511771136 _enter("%p", udp_sk);11781178-11791179- ASSERT(!irqs_disabled());11801180-11811181- skb = skb_recv_udp(udp_sk, 0, 1, &ret);11821182- if (!skb) {11831183- if (ret == -EAGAIN)11841184- return;11851185- _debug("UDP socket error %d", ret);11861186- return;11871187- }1188113711891138 if (skb->tstamp == 0)11901139 skb->tstamp = ktime_get_real();1191114011921141 rxrpc_new_skb(skb, rxrpc_skb_rx_received);1193114211941194- _net("recv skb %p", skb);11951195-11961196- /* we'll probably need to checksum it (didn't call sock_recvmsg) */11971197- if (skb_checksum_complete(skb)) {11981198- rxrpc_free_skb(skb, rxrpc_skb_rx_freed);11991199- __UDP_INC_STATS(&init_net, UDP_MIB_INERRORS, 0);12001200- _leave(" [CSUM failed]");12011201- return;12021202- }12031203-12041204- __UDP_INC_STATS(&init_net, UDP_MIB_INDATAGRAMS, 0);11431143+ skb_pull(skb, sizeof(struct udphdr));1205114412061145 /* The UDP protocol already released all skb resources;12071146 * we are free to add our own data there.···11961177 if ((lose++ & 7) == 7) {11971178 trace_rxrpc_rx_lose(sp);11981179 rxrpc_free_skb(skb, rxrpc_skb_rx_lost);11991199- return;11801180+ return 0;12001181 }12011182 }1202118311841184+ if (skb->tstamp == 0)11851185+ skb->tstamp = ktime_get_real();12031186 trace_rxrpc_rx_packet(sp);1204118712051188 switch (sp->hdr.type) {···12551234 if (sp->hdr.serviceId == 0)12561235 goto bad_message;1257123612581258- rcu_read_lock();12591259-12601237 if (rxrpc_to_server(sp)) {12611238 /* Weed out packets to services we're not offering. Packets12621239 * that would begin a call are explicitly rejected and the rest···12661247 if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA &&12671248 sp->hdr.seq == 1)12681249 goto unsupported_service;12691269- goto discard_unlock;12501250+ goto discard;12701251 }12711252 }12721253···12761257 goto wrong_security;1277125812781259 if (sp->hdr.serviceId != conn->service_id) {12791279- if (!test_bit(RXRPC_CONN_PROBING_FOR_UPGRADE, &conn->flags) ||12801280- conn->service_id != conn->params.service_id)12601260+ int old_id;12611261+12621262+ if (!test_bit(RXRPC_CONN_PROBING_FOR_UPGRADE, &conn->flags))12811263 goto reupgrade;12821282- conn->service_id = sp->hdr.serviceId;12641264+ old_id = cmpxchg(&conn->service_id, conn->params.service_id,12651265+ sp->hdr.serviceId);12661266+12671267+ if (old_id != conn->params.service_id &&12681268+ old_id != sp->hdr.serviceId)12691269+ goto reupgrade;12831270 }1284127112851272 if (sp->hdr.callNumber == 0) {12861273 /* Connection-level packet */12871274 _debug("CONN %p {%d}", conn, conn->debug_id);12881275 rxrpc_post_packet_to_conn(conn, skb);12891289- goto out_unlock;12761276+ goto out;12901277 }1291127812921279 /* Note the serial number skew here */···1311128613121287 /* Ignore really old calls */13131288 if (sp->hdr.callNumber < chan->last_call)13141314- goto discard_unlock;12891289+ goto discard;1315129013161291 if (sp->hdr.callNumber == chan->last_call) {13171292 if (chan->call ||13181293 sp->hdr.type == RXRPC_PACKET_TYPE_ABORT)13191319- goto discard_unlock;12941294+ goto discard;1320129513211296 /* For the previous service call, if completed13221297 * successfully, we discard all further packets.13231298 */13241299 if (rxrpc_conn_is_service(conn) &&13251300 chan->last_type == RXRPC_PACKET_TYPE_ACK)13261326- goto discard_unlock;13011301+ goto discard;1327130213281303 /* But otherwise we need to retransmit the final packet13291304 * from data cached in the connection record.···13341309 sp->hdr.serial,13351310 sp->hdr.flags, 0);13361311 rxrpc_post_packet_to_conn(conn, skb);13371337- goto out_unlock;13121312+ goto out;13381313 }1339131413401315 call = rcu_dereference(chan->call);1341131613421317 if (sp->hdr.callNumber > chan->call_id) {13431343- if (rxrpc_to_client(sp)) {13441344- rcu_read_unlock();13181318+ if (rxrpc_to_client(sp))13451319 goto reject_packet;13461346- }13471320 if (call)13481348- rxrpc_input_implicit_end_call(conn, call);13211321+ rxrpc_input_implicit_end_call(rx, conn, call);13491322 call = NULL;13501323 }13511324···13601337 if (!call || atomic_read(&call->usage) == 0) {13611338 if (rxrpc_to_client(sp) ||13621339 sp->hdr.type != RXRPC_PACKET_TYPE_DATA)13631363- goto bad_message_unlock;13401340+ goto bad_message;13641341 if (sp->hdr.seq != 1)13651365- goto discard_unlock;13661366- call = rxrpc_new_incoming_call(local, rx, peer, conn, skb);13671367- if (!call) {13681368- rcu_read_unlock();13421342+ goto discard;13431343+ call = rxrpc_new_incoming_call(local, rx, skb);13441344+ if (!call)13691345 goto reject_packet;13701370- }13711346 rxrpc_send_ping(call, skb, skew);13721347 mutex_unlock(&call->user_mutex);13731348 }1374134913751350 rxrpc_input_call_packet(call, skb, skew);13761376- goto discard_unlock;13511351+ goto discard;1377135213781378-discard_unlock:13791379- rcu_read_unlock();13801353discard:13811354 rxrpc_free_skb(skb, rxrpc_skb_rx_freed);13821355out:13831356 trace_rxrpc_rx_done(0, 0);13841384- return;13851385-13861386-out_unlock:13871387- rcu_read_unlock();13881388- goto out;13571357+ return 0;1389135813901359wrong_security:13911391- rcu_read_unlock();13921360 trace_rxrpc_abort(0, "SEC", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,13931361 RXKADINCONSISTENCY, EBADMSG);13941362 skb->priority = RXKADINCONSISTENCY;13951363 goto post_abort;1396136413971365unsupported_service:13981398- rcu_read_unlock();13991366 trace_rxrpc_abort(0, "INV", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,14001367 RX_INVALID_OPERATION, EOPNOTSUPP);14011368 skb->priority = RX_INVALID_OPERATION;14021369 goto post_abort;1403137014041371reupgrade:14051405- rcu_read_unlock();14061372 trace_rxrpc_abort(0, "UPG", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,14071373 RX_PROTOCOL_ERROR, EBADMSG);14081374 goto protocol_error;1409137514101410-bad_message_unlock:14111411- rcu_read_unlock();14121376bad_message:14131377 trace_rxrpc_abort(0, "BAD", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,14141378 RX_PROTOCOL_ERROR, EBADMSG);···14071397 trace_rxrpc_rx_done(skb->mark, skb->priority);14081398 rxrpc_reject_packet(local, skb);14091399 _leave(" [badmsg]");14001400+ return 0;14101401}
+24-6
net/rxrpc/local_object.c
···1919#include <linux/ip.h>2020#include <linux/hashtable.h>2121#include <net/sock.h>2222+#include <net/udp.h>2223#include <net/af_rxrpc.h>2324#include "ar-internal.h"2425···109108 */110109static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)111110{112112- struct sock *sock;111111+ struct sock *usk;113112 int ret, opt;114113115114 _enter("%p{%d,%d}",···122121 _leave(" = %d [socket]", ret);123122 return ret;124123 }124124+125125+ /* set the socket up */126126+ usk = local->socket->sk;127127+ inet_sk(usk)->mc_loop = 0;128128+129129+ /* Enable CHECKSUM_UNNECESSARY to CHECKSUM_COMPLETE conversion */130130+ inet_inc_convert_csum(usk);131131+132132+ rcu_assign_sk_user_data(usk, local);133133+134134+ udp_sk(usk)->encap_type = UDP_ENCAP_RXRPC;135135+ udp_sk(usk)->encap_rcv = rxrpc_input_packet;136136+ udp_sk(usk)->encap_destroy = NULL;137137+ udp_sk(usk)->gro_receive = NULL;138138+ udp_sk(usk)->gro_complete = NULL;139139+140140+ udp_encap_enable();141141+#if IS_ENABLED(CONFIG_IPV6)142142+ if (local->srx.transport.family == AF_INET6)143143+ udpv6_encap_enable();144144+#endif145145+ usk->sk_error_report = rxrpc_error_report;125146126147 /* if a local address was supplied then bind it */127148 if (local->srx.transport_len > sizeof(sa_family_t)) {···214191 BUG();215192 }216193217217- /* set the socket up */218218- sock = local->socket->sk;219219- sock->sk_user_data = local;220220- sock->sk_data_ready = rxrpc_data_ready;221221- sock->sk_error_report = rxrpc_error_report;222194 _leave(" = 0");223195 return 0;224196
+5
net/rxrpc/peer_event.c
···303303 if (rtt < 0)304304 return;305305306306+ spin_lock(&peer->rtt_input_lock);307307+306308 /* Replace the oldest datum in the RTT buffer */307309 sum -= peer->rtt_cache[cursor];308310 sum += rtt;···316314 peer->rtt_usage = usage;317315 }318316317317+ spin_unlock(&peer->rtt_input_lock);318318+319319 /* Now recalculate the average */320320 if (usage == RXRPC_RTT_CACHE_SIZE) {321321 avg = sum / RXRPC_RTT_CACHE_SIZE;···326322 do_div(avg, usage);327323 }328324325325+ /* Don't need to update this under lock */329326 peer->rtt = avg;330327 trace_rxrpc_rtt_rx(call, why, send_serial, resp_serial, rtt,331328 usage, avg);
+18-11
net/rxrpc/peer_object.c
···153153 * assess the MTU size for the network interface through which this peer is154154 * reached155155 */156156-static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer)156156+static void rxrpc_assess_MTU_size(struct rxrpc_sock *rx,157157+ struct rxrpc_peer *peer)157158{159159+ struct net *net = sock_net(&rx->sk);158160 struct dst_entry *dst;159161 struct rtable *rt;160162 struct flowi fl;···171169 switch (peer->srx.transport.family) {172170 case AF_INET:173171 rt = ip_route_output_ports(174174- &init_net, fl4, NULL,172172+ net, fl4, NULL,175173 peer->srx.transport.sin.sin_addr.s_addr, 0,176174 htons(7000), htons(7001), IPPROTO_UDP, 0, 0);177175 if (IS_ERR(rt)) {···190188 sizeof(struct in6_addr));191189 fl6->fl6_dport = htons(7001);192190 fl6->fl6_sport = htons(7000);193193- dst = ip6_route_output(&init_net, NULL, fl6);191191+ dst = ip6_route_output(net, NULL, fl6);194192 if (dst->error) {195193 _leave(" [route err %d]", dst->error);196194 return;···225223 peer->service_conns = RB_ROOT;226224 seqlock_init(&peer->service_conn_lock);227225 spin_lock_init(&peer->lock);226226+ spin_lock_init(&peer->rtt_input_lock);228227 peer->debug_id = atomic_inc_return(&rxrpc_debug_id);229228230229 if (RXRPC_TX_SMSS > 2190)···243240/*244241 * Initialise peer record.245242 */246246-static void rxrpc_init_peer(struct rxrpc_peer *peer, unsigned long hash_key)243243+static void rxrpc_init_peer(struct rxrpc_sock *rx, struct rxrpc_peer *peer,244244+ unsigned long hash_key)247245{248246 peer->hash_key = hash_key;249249- rxrpc_assess_MTU_size(peer);247247+ rxrpc_assess_MTU_size(rx, peer);250248 peer->mtu = peer->if_mtu;251249 peer->rtt_last_req = ktime_get_real();252250···279275/*280276 * Set up a new peer.281277 */282282-static struct rxrpc_peer *rxrpc_create_peer(struct rxrpc_local *local,278278+static struct rxrpc_peer *rxrpc_create_peer(struct rxrpc_sock *rx,279279+ struct rxrpc_local *local,283280 struct sockaddr_rxrpc *srx,284281 unsigned long hash_key,285282 gfp_t gfp)···292287 peer = rxrpc_alloc_peer(local, gfp);293288 if (peer) {294289 memcpy(&peer->srx, srx, sizeof(*srx));295295- rxrpc_init_peer(peer, hash_key);290290+ rxrpc_init_peer(rx, peer, hash_key);296291 }297292298293 _leave(" = %p", peer);···304299 * since we've already done a search in the list from the non-reentrant context305300 * (the data_ready handler) that is the only place we can add new peers.306301 */307307-void rxrpc_new_incoming_peer(struct rxrpc_local *local, struct rxrpc_peer *peer)302302+void rxrpc_new_incoming_peer(struct rxrpc_sock *rx, struct rxrpc_local *local,303303+ struct rxrpc_peer *peer)308304{309305 struct rxrpc_net *rxnet = local->rxnet;310306 unsigned long hash_key;311307312308 hash_key = rxrpc_peer_hash_key(local, &peer->srx);313309 peer->local = local;314314- rxrpc_init_peer(peer, hash_key);310310+ rxrpc_init_peer(rx, peer, hash_key);315311316312 spin_lock(&rxnet->peer_hash_lock);317313 hash_add_rcu(rxnet->peer_hash, &peer->hash_link, hash_key);···323317/*324318 * obtain a remote transport endpoint for the specified address325319 */326326-struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_local *local,320320+struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_sock *rx,321321+ struct rxrpc_local *local,327322 struct sockaddr_rxrpc *srx, gfp_t gfp)328323{329324 struct rxrpc_peer *peer, *candidate;···344337 /* The peer is not yet present in hash - create a candidate345338 * for a new record and then redo the search.346339 */347347- candidate = rxrpc_create_peer(local, srx, hash_key, gfp);340340+ candidate = rxrpc_create_peer(rx, local, srx, hash_key, gfp);348341 if (!candidate) {349342 _leave(" = NULL [nomem]");350343 return NULL;
···440440441441def sample_table(*x):442442 if branches:443443- bind_exec(sample_query, 18, x)443443+ for xx in x[0:15]:444444+ sample_query.addBindValue(str(xx))445445+ for xx in x[19:22]:446446+ sample_query.addBindValue(str(xx))447447+ do_query_(sample_query)444448 else:445449 bind_exec(sample_query, 22, x)446450
+5-3
tools/perf/util/machine.c
···22862286 if (!symbol_conf.inline_name || !map || !sym)22872287 return ret;2288228822892289- addr = map__rip_2objdump(map, ip);22892289+ addr = map__map_ip(map, ip);22902290+ addr = map__rip_2objdump(map, addr);2290229122912292 inline_node = inlines__tree_find(&map->dso->inlined_nodes, addr);22922293 if (!inline_node) {···23132312{23142313 struct callchain_cursor *cursor = arg;23152314 const char *srcline = NULL;23162316- u64 addr;23152315+ u64 addr = entry->ip;2317231623182317 if (symbol_conf.hide_unresolved && entry->sym == NULL)23192318 return 0;···23252324 * Convert entry->ip from a virtual address to an offset in23262325 * its corresponding binary.23272326 */23282328- addr = map__map_ip(entry->map, entry->ip);23272327+ if (entry->map)23282328+ addr = map__map_ip(entry->map, entry->ip);2329232923302330 srcline = callchain_srcline(entry->map, entry->sym, addr);23312331 return callchain_cursor_append(cursor, entry->ip,
+1-1
tools/perf/util/setup.py
···35353636cflags = getenv('CFLAGS', '').split()3737# switch off several checks (need to be at the end of cflags list)3838-cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter' ]3838+cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]3939if cc != "clang":4040 cflags += ['-Wno-cast-function-type' ]4141
+1-1
tools/testing/selftests/net/rtnetlink.sh
···11-#!/bin/sh11+#!/bin/bash22#33# This test is for checking rtnetlink callpaths, and get as much coverage as possible.44#
+1-1
tools/testing/selftests/net/udpgso_bench.sh
···11-#!/bin/sh11+#!/bin/bash22# SPDX-License-Identifier: GPL-2.033#44# Run a series of udpgso benchmarks