···57965796 expediting. Set to zero to disable automatic57975797 expediting.5798579857995799+ srcutree.srcu_max_nodelay [KNL]58005800+ Specifies the number of no-delay instances58015801+ per jiffy for which the SRCU grace period58025802+ worker thread will be rescheduled with zero58035803+ delay. Beyond this limit, worker thread will58045804+ be rescheduled with a sleep delay of one jiffy.58055805+58065806+ srcutree.srcu_max_nodelay_phase [KNL]58075807+ Specifies the per-grace-period phase, number of58085808+ non-sleeping polls of readers. Beyond this limit,58095809+ grace period worker thread will be rescheduled58105810+ with a sleep delay of one jiffy, between each58115811+ rescan of the readers, for a grace period phase.58125812+58135813+ srcutree.srcu_retry_check_delay [KNL]58145814+ Specifies number of microseconds of non-sleeping58155815+ delay between each non-sleeping poll of readers.58165816+57995817 srcutree.small_contention_lim [KNL]58005818 Specifies the number of update-side contention58015819 events per jiffy will be tolerated before
···187187 Should specify the gpio for phy reset.188188189189 phy-reset-duration:190190+ $ref: /schemas/types.yaml#/definitions/uint32190191 deprecated: true191192 description:192193 Reset duration in milliseconds. Should present only if property···196195 and 1 millisecond will be used instead.197196198197 phy-reset-active-high:198198+ type: boolean199199 deprecated: true200200 description:201201 If present then the reset sequence using the GPIO specified in the202202 "phy-reset-gpios" property is reversed (H=reset state, L=operation state).203203204204 phy-reset-post-delay:205205+ $ref: /schemas/types.yaml#/definitions/uint32205206 deprecated: true206207 description:207208 Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay
+8-1
Documentation/networking/ip-sysctl.rst
···28842884 Default: 4K2885288528862886sctp_wmem - vector of 3 INTEGERs: min, default, max28872887- Currently this tunable has no effect.28872887+ Only the first value ("min") is used, "default" and "max" are28882888+ ignored.28892889+28902890+ min: Minimum size of send buffer that can be used by SCTP sockets.28912891+ It is guaranteed to each SCTP socket (but not association) even28922892+ under moderate memory pressure.28932893+28942894+ Default: 4K2888289528892896addr_scope_policy - INTEGER28902897 Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00
···7373endif74747575KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax)7676+KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax)76777778# GCC versions that support the "-mstrict-align" option default to allowing7879# unaligned accesses. While unaligned accesses are explicitly allowed in the
···22/*33 * Kernel interface for the s390 arch_random_* functions44 *55- * Copyright IBM Corp. 2017, 202055+ * Copyright IBM Corp. 2017, 202266 *77 * Author: Harald Freudenberger <freude@de.ibm.com>88 *···1414#ifdef CONFIG_ARCH_RANDOM15151616#include <linux/static_key.h>1717+#include <linux/preempt.h>1718#include <linux/atomic.h>1819#include <asm/cpacf.h>1920···33323433static inline bool __must_check arch_get_random_seed_long(unsigned long *v)3534{3636- if (static_branch_likely(&s390_arch_random_available)) {3535+ if (static_branch_likely(&s390_arch_random_available) &&3636+ in_task()) {3737 cpacf_trng(NULL, 0, (u8 *)v, sizeof(*v));3838 atomic64_add(sizeof(*v), &s390_arch_random_counter);3939 return true;···44424543static inline bool __must_check arch_get_random_seed_int(unsigned int *v)4644{4747- if (static_branch_likely(&s390_arch_random_available)) {4545+ if (static_branch_likely(&s390_arch_random_available) &&4646+ in_task()) {4847 cpacf_trng(NULL, 0, (u8 *)v, sizeof(*v));4948 atomic64_add(sizeof(*v), &s390_arch_random_counter);5049 return true;
+4-4
arch/x86/Kconfig
···24742474 bool "Enable return-thunks"24752475 depends on RETPOLINE && CC_HAS_RETURN_THUNK24762476 select OBJTOOL if HAVE_OBJTOOL24772477- default y24772477+ default y if X86_6424782478 help24792479 Compile the kernel with the return-thunks compiler option to guard24802480 against kernel-to-user data leaks by avoiding return speculation.···2483248324842484config CPU_UNRET_ENTRY24852485 bool "Enable UNRET on kernel entry"24862486- depends on CPU_SUP_AMD && RETHUNK24862486+ depends on CPU_SUP_AMD && RETHUNK && X86_6424872487 default y24882488 help24892489 Compile the kernel with support for the retbleed=unret mitigation.2490249024912491config CPU_IBPB_ENTRY24922492 bool "Enable IBPB on kernel entry"24932493- depends on CPU_SUP_AMD24932493+ depends on CPU_SUP_AMD && X86_6424942494 default y24952495 help24962496 Compile the kernel with support for the retbleed=ibpb mitigation.2497249724982498config CPU_IBRS_ENTRY24992499 bool "Enable IBRS on kernel entry"25002500- depends on CPU_SUP_INTEL25002500+ depends on CPU_SUP_INTEL && X86_6425012501 default y25022502 help25032503 Compile the kernel with support for the spectre_v2=ibrs mitigation.
···278278};279279280280/*281281- * For formats with LBR_TSX flags (e.g. LBR_FORMAT_EIP_FLAGS2), bits 61:62 in282282- * MSR_LAST_BRANCH_FROM_x are the TSX flags when TSX is supported, but when283283- * TSX is not supported they have no consistent behavior:281281+ * For format LBR_FORMAT_EIP_FLAGS2, bits 61:62 in MSR_LAST_BRANCH_FROM_x282282+ * are the TSX flags when TSX is supported, but when TSX is not supported283283+ * they have no consistent behavior:284284 *285285 * - For wrmsr(), bits 61:62 are considered part of the sign extension.286286 * - For HW updates (branch captures) bits 61:62 are always OFF and are not···288288 *289289 * Therefore, if:290290 *291291- * 1) LBR has TSX format291291+ * 1) LBR format LBR_FORMAT_EIP_FLAGS2292292 * 2) CPU has no TSX support enabled293293 *294294 * ... then any value passed to wrmsr() must be sign extended to 63 bits and any···300300 bool tsx_support = boot_cpu_has(X86_FEATURE_HLE) ||301301 boot_cpu_has(X86_FEATURE_RTM);302302303303- return !tsx_support && x86_pmu.lbr_has_tsx;303303+ return !tsx_support;304304}305305306306static DEFINE_STATIC_KEY_FALSE(lbr_from_quirk_key);···16091609 x86_pmu.lbr_sel_map = hsw_lbr_sel_map;1610161016111611 x86_get_pmu(smp_processor_id())->task_ctx_cache = create_lbr_kmem_cache(size, 0);16121612-16131613- if (lbr_from_signext_quirk_needed())16141614- static_branch_enable(&lbr_from_quirk_key);16151612}1616161316171614/* skylake */···16991702 switch (x86_pmu.intel_cap.lbr_format) {17001703 case LBR_FORMAT_EIP_FLAGS2:17011704 x86_pmu.lbr_has_tsx = 1;17021702- fallthrough;17051705+ x86_pmu.lbr_from_flags = 1;17061706+ if (lbr_from_signext_quirk_needed())17071707+ static_branch_enable(&lbr_from_quirk_key);17081708+ break;17091709+17031710 case LBR_FORMAT_EIP_FLAGS:17041711 x86_pmu.lbr_from_flags = 1;17051712 break;
+1
arch/x86/include/asm/cpufeatures.h
···302302#define X86_FEATURE_RETPOLINE_LFENCE (11*32+13) /* "" Use LFENCE for Spectre variant 2 */303303#define X86_FEATURE_RETHUNK (11*32+14) /* "" Use REturn THUNK */304304#define X86_FEATURE_UNRET (11*32+15) /* "" AMD BTB untrain return */305305+#define X86_FEATURE_USE_IBPB_FW (11*32+16) /* "" Use IBPB during runtime firmware calls */305306306307/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */307308#define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */
···975975#define SPECTRE_V2_LFENCE_MSG "WARNING: LFENCE mitigation is not recommended for this CPU, data leaks possible!\n"976976#define SPECTRE_V2_EIBRS_EBPF_MSG "WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!\n"977977#define SPECTRE_V2_EIBRS_LFENCE_EBPF_SMT_MSG "WARNING: Unprivileged eBPF is enabled with eIBRS+LFENCE mitigation and SMT, data leaks possible via Spectre v2 BHB attacks!\n"978978+#define SPECTRE_V2_IBRS_PERF_MSG "WARNING: IBRS mitigation selected on Enhanced IBRS CPU, this may cause unnecessary performance loss\n"978979979980#ifdef CONFIG_BPF_SYSCALL980981void unpriv_ebpf_notify(int new_state)···1416141514171416 case SPECTRE_V2_IBRS:14181417 setup_force_cpu_cap(X86_FEATURE_KERNEL_IBRS);14181418+ if (boot_cpu_has(X86_FEATURE_IBRS_ENHANCED))14191419+ pr_warn(SPECTRE_V2_IBRS_PERF_MSG);14191420 break;1420142114211422 case SPECTRE_V2_LFENCE:···15191516 * the CPU supports Enhanced IBRS, kernel might un-intentionally not15201517 * enable IBRS around firmware calls.15211518 */15221522- if (boot_cpu_has(X86_FEATURE_IBRS) && !spectre_v2_in_ibrs_mode(mode)) {15191519+ if (boot_cpu_has_bug(X86_BUG_RETBLEED) &&15201520+ (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||15211521+ boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)) {15221522+15231523+ if (retbleed_cmd != RETBLEED_CMD_IBPB) {15241524+ setup_force_cpu_cap(X86_FEATURE_USE_IBPB_FW);15251525+ pr_info("Enabling Speculation Barrier for firmware calls\n");15261526+ }15271527+15281528+ } else if (boot_cpu_has(X86_FEATURE_IBRS) && !spectre_v2_in_ibrs_mode(mode)) {15231529 setup_force_cpu_cap(X86_FEATURE_USE_IBRS_FW);15241530 pr_info("Enabling Restricted Speculation for firmware calls\n");15251531 }
+8
arch/x86/kvm/x86.c
···60296029 r = 0;60306030 break;60316031 case KVM_CAP_X86_USER_SPACE_MSR:60326032+ r = -EINVAL;60336033+ if (cap->args[0] & ~(KVM_MSR_EXIT_REASON_INVAL |60346034+ KVM_MSR_EXIT_REASON_UNKNOWN |60356035+ KVM_MSR_EXIT_REASON_FILTER))60366036+ break;60326037 kvm->arch.user_space_msr_mask = cap->args[0];60336038 r = 0;60346039 break;···6187618261886183 if (copy_from_user(&filter, user_msr_filter, sizeof(filter)))61896184 return -EFAULT;61856185+61866186+ if (filter.flags & ~KVM_MSR_FILTER_DEFAULT_DENY)61876187+ return -EINVAL;6190618861916189 for (i = 0; i < ARRAY_SIZE(filter.ranges); i++)61926190 empty &= !filter.ranges[i].nmsrs;
+1
certs/Kconfig
···4343 bool "Provide system-wide ring of trusted keys"4444 depends on KEYS4545 depends on ASYMMETRIC_KEY_TYPE4646+ depends on X509_CERTIFICATE_PARSER4647 help4748 Provide a system keyring to which trusted keys can be added. Keys in4849 the keyring are considered to be trusted. Keys may be added at will
+4-2
drivers/acpi/cppc_acpi.c
···782782783783 if (!osc_cpc_flexible_adr_space_confirmed) {784784 pr_debug("Flexible address space capability not supported\n");785785- goto out_free;785785+ if (!cpc_supported_by_cpu())786786+ goto out_free;786787 }787788788789 addr = ioremap(gas_t->address, gas_t->bit_width/8);···810809 }811810 if (!osc_cpc_flexible_adr_space_confirmed) {812811 pr_debug("Flexible address space capability not supported\n");813813- goto out_free;812812+ if (!cpc_supported_by_cpu())813813+ goto out_free;814814 }815815 } else {816816 if (gas_t->space_id != ACPI_ADR_SPACE_FIXED_HARDWARE || !cpc_ffh_supported()) {
···519519 return r;520520 }521521522522+ mutex_lock(&p->bo_list->bo_list_mutex);523523+522524 /* One for TTM and one for the CS job */523525 amdgpu_bo_list_for_each_entry(e, p->bo_list)524526 e->tv.num_shared = 2;···653651 kvfree(e->user_pages);654652 e->user_pages = NULL;655653 }654654+ mutex_unlock(&p->bo_list->bo_list_mutex);656655 }657656 return r;658657}···693690{694691 unsigned i;695692696696- if (error && backoff)693693+ if (error && backoff) {697694 ttm_eu_backoff_reservation(&parser->ticket,698695 &parser->validated);696696+ mutex_unlock(&parser->bo_list->bo_list_mutex);697697+ }699698700699 for (i = 0; i < parser->num_post_deps; i++) {701700 drm_syncobj_put(parser->post_deps[i].syncobj);···837832 continue;838833839834 r = amdgpu_vm_bo_update(adev, bo_va, false);840840- if (r)835835+ if (r) {836836+ mutex_unlock(&p->bo_list->bo_list_mutex);841837 return r;838838+ }842839843840 r = amdgpu_sync_fence(&p->job->sync, bo_va->last_pt_update);844844- if (r)841841+ if (r) {842842+ mutex_unlock(&p->bo_list->bo_list_mutex);845843 return r;844844+ }846845 }847846848847 r = amdgpu_vm_handle_moved(adev, vm);···1287127812881279 ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence);12891280 mutex_unlock(&p->adev->notifier_lock);12811281+ mutex_unlock(&p->bo_list->bo_list_mutex);1290128212911283 return 0;12921284
+19-8
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
···16531653#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)16541654 adev->dm.crc_rd_wrk = amdgpu_dm_crtc_secure_display_create_work();16551655#endif16561656- if (dc_enable_dmub_notifications(adev->dm.dc)) {16561656+ if (dc_is_dmub_outbox_supported(adev->dm.dc)) {16571657 init_completion(&adev->dm.dmub_aux_transfer_done);16581658 adev->dm.dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_KERNEL);16591659 if (!adev->dm.dmub_notify) {···16881688 "amdgpu: failed to initialize sw for display support.\n");16891689 goto error;16901690 }16911691+16921692+ /* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.16931693+ * It is expected that DMUB will resend any pending notifications at this point, for16941694+ * example HPD from DPIA.16951695+ */16961696+ if (dc_is_dmub_outbox_supported(adev->dm.dc))16971697+ dc_enable_dmub_outbox(adev->dm.dc);1691169816921699 /* create fake encoders for MST */16931700 dm_dp_create_fake_mst_encoders(adev);···26852678 */26862679 link_enc_cfg_copy(adev->dm.dc->current_state, dc_state);2687268026882688- if (dc_enable_dmub_notifications(adev->dm.dc))26892689- amdgpu_dm_outbox_init(adev);26902690-26912681 r = dm_dmub_hw_init(adev);26922682 if (r)26932683 DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);···27002696 dc_state->stream_status[i].plane_states[j]->update_flags.raw27012697 = 0xffffffff;27022698 }26992699+ }27002700+27012701+ if (dc_is_dmub_outbox_supported(adev->dm.dc)) {27022702+ amdgpu_dm_outbox_init(adev);27032703+ dc_enable_dmub_outbox(adev->dm.dc);27032704 }2704270527052706 WARN_ON(!dc_commit_state(dm->dc, dc_state));···27282719 /* TODO: Remove dc_state->dccg, use dc->dccg directly. */27292720 dc_resource_state_construct(dm->dc, dm_state->context);2730272127312731- /* Re-enable outbox interrupts for DPIA. */27322732- if (dc_enable_dmub_notifications(adev->dm.dc))27332733- amdgpu_dm_outbox_init(adev);27342734-27352722 /* Before powering on DC we need to re-initialize DMUB. */27362723 dm_dmub_hw_resume(adev);27242724+27252725+ /* Re-enable outbox interrupts for DPIA. */27262726+ if (dc_is_dmub_outbox_supported(adev->dm.dc)) {27272727+ amdgpu_dm_outbox_init(adev);27282728+ dc_enable_dmub_outbox(adev->dm.dc);27292729+ }2737273027382731 /* power on hardware */27392732 dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
···273273 u8 child_index;274274 /** @guc: GuC specific members for parallel submission */275275 struct {276276- /** @wqi_head: head pointer in work queue */276276+ /** @wqi_head: cached head pointer in work queue */277277 u16 wqi_head;278278- /** @wqi_tail: tail pointer in work queue */278278+ /** @wqi_tail: cached tail pointer in work queue */279279 u16 wqi_tail;280280+ /** @wq_head: pointer to the actual head in work queue */281281+ u32 *wq_head;282282+ /** @wq_tail: pointer to the actual head in work queue */283283+ u32 *wq_tail;284284+ /** @wq_status: pointer to the status in work queue */285285+ u32 *wq_status;286286+280287 /**281288 * @parent_page: page in context state (ce->state) used282289 * by parent for work queue, process descriptor
···170170 /** @ads_engine_usage_size: size of engine usage in the ADS */171171 u32 ads_engine_usage_size;172172173173+ /** @lrc_desc_pool_v69: object allocated to hold the GuC LRC descriptor pool */174174+ struct i915_vma *lrc_desc_pool_v69;175175+ /** @lrc_desc_pool_vaddr_v69: contents of the GuC LRC descriptor pool */176176+ void *lrc_desc_pool_vaddr_v69;177177+173178 /**174179 * @context_lookup: used to resolve intel_context from guc_id, if a175180 * context is present in this structure it is registered with the GuC
+45
drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
···203203 u32 fence_id;204204} __packed;205205206206+struct guc_process_desc_v69 {207207+ u32 stage_id;208208+ u64 db_base_addr;209209+ u32 head;210210+ u32 tail;211211+ u32 error_offset;212212+ u64 wq_base_addr;213213+ u32 wq_size_bytes;214214+ u32 wq_status;215215+ u32 engine_presence;216216+ u32 priority;217217+ u32 reserved[36];218218+} __packed;219219+206220struct guc_sched_wq_desc {207221 u32 head;208222 u32 tail;···240226 u32 hwlrca_hi;241227};242228#define CONTEXT_REGISTRATION_FLAG_KMD BIT(0)229229+230230+/* Preempt to idle on quantum expiry */231231+#define CONTEXT_POLICY_FLAG_PREEMPT_TO_IDLE_V69 BIT(0)232232+233233+/*234234+ * GuC Context registration descriptor.235235+ * FIXME: This is only required to exist during context registration.236236+ * The current 1:1 between guc_lrc_desc and LRCs for the lifetime of the LRC237237+ * is not required.238238+ */239239+struct guc_lrc_desc_v69 {240240+ u32 hw_context_desc;241241+ u32 slpm_perf_mode_hint; /* SPLC v1 only */242242+ u32 slpm_freq_hint;243243+ u32 engine_submit_mask; /* In logical space */244244+ u8 engine_class;245245+ u8 reserved0[3];246246+ u32 priority;247247+ u32 process_desc;248248+ u32 wq_addr;249249+ u32 wq_size;250250+ u32 context_flags; /* CONTEXT_REGISTRATION_* */251251+ /* Time for one workload to execute. (in micro seconds) */252252+ u32 execution_quantum;253253+ /* Time to wait for a preemption request to complete before issuing a254254+ * reset. (in micro seconds).255255+ */256256+ u32 preemption_timeout;257257+ u32 policy_flags; /* CONTEXT_POLICY_* */258258+ u32 reserved1[19];259259+} __packed;243260244261/* 32-bit KLV structure as used by policy updates and others */245262struct guc_klv_generic_dw_t {
···207207208208 ret = dcss_submodules_init(dcss);209209 if (ret) {210210+ of_node_put(dcss->of_port);210211 dev_err(dev, "submodules initialization failed\n");211212 goto clks_err;212213 }···237236 dcss_ctxld_suspend(dcss->ctxld);238237 dcss_clocks_disable(dcss);239238 }239239+240240+ of_node_put(dcss->of_port);240241241242 pm_runtime_disable(dcss->dev);242243
+1-1
drivers/gpu/drm/panel/panel-edp.c
···713713 of_property_read_u32(dev->of_node, "hpd-reliable-delay-ms", &reliable_ms);714714 desc->delay.hpd_reliable = reliable_ms;715715 of_property_read_u32(dev->of_node, "hpd-absent-delay-ms", &absent_ms);716716- desc->delay.hpd_reliable = absent_ms;716716+ desc->delay.hpd_absent = absent_ms;717717718718 /* Power the panel on so we can read the EDID */719719 ret = pm_runtime_get_sync(dev);
···388388 */389389static irqreturn_t cdns_i2c_master_isr(void *ptr)390390{391391- unsigned int isr_status, avail_bytes, updatetx;391391+ unsigned int isr_status, avail_bytes;392392 unsigned int bytes_to_send;393393- bool hold_quirk;393393+ bool updatetx;394394 struct cdns_i2c *id = ptr;395395 /* Signal completion only after everything is updated */396396 int done_flag = 0;···410410 * Check if transfer size register needs to be updated again for a411411 * large data receive operation.412412 */413413- updatetx = 0;414414- if (id->recv_count > id->curr_recv_count)415415- updatetx = 1;416416-417417- hold_quirk = (id->quirks & CDNS_I2C_BROKEN_HOLD_BIT) && updatetx;413413+ updatetx = id->recv_count > id->curr_recv_count;418414419415 /* When receiving, handle data interrupt and completion interrupt */420416 if (id->p_recv_buf &&···441445 break;442446 }443447444444- if (cdns_is_holdquirk(id, hold_quirk))448448+ if (cdns_is_holdquirk(id, updatetx))445449 break;446450 }447451···452456 * maintain transfer size non-zero while performing a large453457 * receive operation.454458 */455455- if (cdns_is_holdquirk(id, hold_quirk)) {459459+ if (cdns_is_holdquirk(id, updatetx)) {456460 /* wait while fifo is full */457461 while (cdns_i2c_readreg(CDNS_I2C_XFER_SIZE_OFFSET) !=458462 (id->curr_recv_count - CDNS_I2C_FIFO_DEPTH))···472476 cdns_i2c_writereg(id->recv_count -473477 CDNS_I2C_FIFO_DEPTH,474478 CDNS_I2C_XFER_SIZE_OFFSET);475475- id->curr_recv_count = id->recv_count;476476- }477477- } else if (id->recv_count && !hold_quirk &&478478- !id->curr_recv_count) {479479-480480- /* Set the slave address in address register*/481481- cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK,482482- CDNS_I2C_ADDR_OFFSET);483483-484484- if (id->recv_count > CDNS_I2C_TRANSFER_SIZE) {485485- cdns_i2c_writereg(CDNS_I2C_TRANSFER_SIZE,486486- CDNS_I2C_XFER_SIZE_OFFSET);487487- id->curr_recv_count = CDNS_I2C_TRANSFER_SIZE;488488- } else {489489- cdns_i2c_writereg(id->recv_count,490490- CDNS_I2C_XFER_SIZE_OFFSET);491479 id->curr_recv_count = id->recv_count;492480 }493481 }
+1-1
drivers/i2c/busses/i2c-imx.c
···66666767/* IMX I2C registers:6868 * the I2C register offset is different between SoCs,6969- * to provid support for all these chips, split the6969+ * to provide support for all these chips, split the7070 * register offset into a fixed base address and a7171 * variable shift value, then the full register offset7272 * will be calculated by
···73047304 goto abort;73057305 conf->mddev = mddev;7306730673077307- if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL)73077307+ ret = -ENOMEM;73087308+ conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL);73097309+ if (!conf->stripe_hashtbl)73087310 goto abort;7309731173107312 /* We init hash_locks[0] separately to that it can be used
···12981298 /*12991299 * omap_device_pm_domain has callbacks to enable the main13001300 * functional clock, interface clock and also configure the13011301- * SYSCONFIG register of omap devices. The callback will be invoked13021302- * as part of pm_runtime_get_sync.13011301+ * SYSCONFIG register to clear any boot loader set voltage13021302+ * capabilities before calling sdhci_setup_host(). The13031303+ * callback will be invoked as part of pm_runtime_get_sync.13031304 */13041305 pm_runtime_use_autosuspend(dev);13051306 pm_runtime_set_autosuspend_delay(dev, 50);···14421441 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);14431442 struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);1444144314451445- sdhci_runtime_suspend_host(host);14441444+ if (omap_host->con != -EINVAL)14451445+ sdhci_runtime_suspend_host(host);1446144614471447 sdhci_omap_context_save(omap_host);14481448···1460145814611459 pinctrl_pm_select_default_state(dev);1462146014631463- if (omap_host->con != -EINVAL)14611461+ if (omap_host->con != -EINVAL) {14641462 sdhci_omap_context_restore(omap_host);14651465-14661466- sdhci_runtime_resume_host(host, 0);14631463+ sdhci_runtime_resume_host(host, 0);14641464+ }1467146514681466 return 0;14691467}
···20332033 * non-zero req_queue_pairs says that user requested a new20342034 * queue count via ethtool's set_channels, so use this20352035 * value for queues distribution across traffic classes20362036+ * We need at least one queue pair for the interface20372037+ * to be usable as we see in else statement.20362038 */20372039 if (vsi->req_queue_pairs > 0)20382040 vsi->num_queue_pairs = vsi->req_queue_pairs;20392041 else if (pf->flags & I40E_FLAG_MSIX_ENABLED)20402042 vsi->num_queue_pairs = pf->num_lan_msix;20432043+ else20442044+ vsi->num_queue_pairs = 1;20412045 }2042204620432047 /* Number of queues per enabled TC */
···42334233 }4234423442354235 /* If the chain is ended by an load/store pair then this42364236- * could serve as the new head of the the next chain.42364236+ * could serve as the new head of the next chain.42374237 */42384238 if (curr_pair_is_memcpy(meta1, meta2)) {42394239 head_ld_meta = meta1;
+22
drivers/net/ethernet/sfc/ptp.c
···1100110011011101 tx_queue = efx_channel_get_tx_queue(ptp_data->channel, type);11021102 if (tx_queue && tx_queue->timestamping) {11031103+ /* This code invokes normal driver TX code which is always11041104+ * protected from softirqs when called from generic TX code,11051105+ * which in turn disables preemption. Look at __dev_queue_xmit11061106+ * which uses rcu_read_lock_bh disabling preemption for RCU11071107+ * plus disabling softirqs. We do not need RCU reader11081108+ * protection here.11091109+ *11101110+ * Although it is theoretically safe for current PTP TX/RX code11111111+ * running without disabling softirqs, there are three good11121112+ * reasond for doing so:11131113+ *11141114+ * 1) The code invoked is mainly implemented for non-PTP11151115+ * packets and it is always executed with softirqs11161116+ * disabled.11171117+ * 2) This being a single PTP packet, better to not11181118+ * interrupt its processing by softirqs which can lead11191119+ * to high latencies.11201120+ * 3) netdev_xmit_more checks preemption is disabled and11211121+ * triggers a BUG_ON if not.11221122+ */11231123+ local_bh_disable();11031124 efx_enqueue_skb(tx_queue, skb);11251125+ local_bh_enable();11041126 } else {11051127 WARN_ONCE(1, "PTP channel has no timestamped tx queue\n");11061128 dev_kfree_skb_any(skb);
···688688689689 ret = mediatek_dwmac_clks_config(priv_plat, true);690690 if (ret)691691- return ret;691691+ goto err_remove_config_dt;692692693693 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);694694- if (ret) {695695- stmmac_remove_config_dt(pdev, plat_dat);694694+ if (ret)696695 goto err_drv_probe;697697- }698696699697 return 0;700698701699err_drv_probe:702700 mediatek_dwmac_clks_config(priv_plat, false);701701+err_remove_config_dt:702702+ stmmac_remove_config_dt(pdev, plat_dat);703703+703704 return ret;704705}705706
+1-1
drivers/net/ipa/ipa_qmi_msg.h
···214214215215/* The response to a IPA_QMI_INIT_DRIVER request begins with a standard216216 * QMI response, but contains other information as well. Currently we217217- * simply wait for the the INIT_DRIVER transaction to complete and217217+ * simply wait for the INIT_DRIVER transaction to complete and218218 * ignore any other data that might be returned.219219 */220220struct ipa_init_modem_driver_rsp {
+21-12
drivers/net/macsec.c
···243243#define DEFAULT_SEND_SCI true244244#define DEFAULT_ENCRYPT false245245#define DEFAULT_ENCODING_SA 0246246+#define MACSEC_XPN_MAX_REPLAY_WINDOW (((1 << 30) - 1))246247247248static bool send_sci(const struct macsec_secy *secy)248249{···16981697 return false;1699169817001699 if (attrs[MACSEC_SA_ATTR_PN] &&17011701- *(u64 *)nla_data(attrs[MACSEC_SA_ATTR_PN]) == 0)17001700+ nla_get_u64(attrs[MACSEC_SA_ATTR_PN]) == 0)17021701 return false;1703170217041703 if (attrs[MACSEC_SA_ATTR_ACTIVE]) {···17541753 }1755175417561755 pn_len = secy->xpn ? MACSEC_XPN_PN_LEN : MACSEC_DEFAULT_PN_LEN;17571757- if (nla_len(tb_sa[MACSEC_SA_ATTR_PN]) != pn_len) {17561756+ if (tb_sa[MACSEC_SA_ATTR_PN] &&17571757+ nla_len(tb_sa[MACSEC_SA_ATTR_PN]) != pn_len) {17581758 pr_notice("macsec: nl: add_rxsa: bad pn length: %d != %d\n",17591759 nla_len(tb_sa[MACSEC_SA_ATTR_PN]), pn_len);17601760 rtnl_unlock();···17711769 if (nla_len(tb_sa[MACSEC_SA_ATTR_SALT]) != MACSEC_SALT_LEN) {17721770 pr_notice("macsec: nl: add_rxsa: bad salt length: %d != %d\n",17731771 nla_len(tb_sa[MACSEC_SA_ATTR_SALT]),17741774- MACSEC_SA_ATTR_SALT);17721772+ MACSEC_SALT_LEN);17751773 rtnl_unlock();17761774 return -EINVAL;17771775 }···18441842 return 0;1845184318461844cleanup:18471847- kfree(rx_sa);18451845+ macsec_rxsa_put(rx_sa);18481846 rtnl_unlock();18491847 return err;18501848}···19411939 if (nla_get_u8(attrs[MACSEC_SA_ATTR_AN]) >= MACSEC_NUM_AN)19421940 return false;1943194119441944- if (nla_get_u32(attrs[MACSEC_SA_ATTR_PN]) == 0)19421942+ if (nla_get_u64(attrs[MACSEC_SA_ATTR_PN]) == 0)19451943 return false;1946194419471945 if (attrs[MACSEC_SA_ATTR_ACTIVE]) {···20132011 if (nla_len(tb_sa[MACSEC_SA_ATTR_SALT]) != MACSEC_SALT_LEN) {20142012 pr_notice("macsec: nl: add_txsa: bad salt length: %d != %d\n",20152013 nla_len(tb_sa[MACSEC_SA_ATTR_SALT]),20162016- MACSEC_SA_ATTR_SALT);20142014+ MACSEC_SALT_LEN);20172015 rtnl_unlock();20182016 return -EINVAL;20192017 }···2087208520882086cleanup:20892087 secy->operational = was_operational;20902090- kfree(tx_sa);20882088+ macsec_txsa_put(tx_sa);20912089 rtnl_unlock();20922090 return err;20932091}···22952293 if (nla_get_u8(attrs[MACSEC_SA_ATTR_AN]) >= MACSEC_NUM_AN)22962294 return false;2297229522982298- if (attrs[MACSEC_SA_ATTR_PN] && nla_get_u32(attrs[MACSEC_SA_ATTR_PN]) == 0)22962296+ if (attrs[MACSEC_SA_ATTR_PN] && nla_get_u64(attrs[MACSEC_SA_ATTR_PN]) == 0)22992297 return false;2300229823012299 if (attrs[MACSEC_SA_ATTR_ACTIVE]) {···37473745 secy->operational = tx_sa && tx_sa->active;37483746 }3749374737503750- if (data[IFLA_MACSEC_WINDOW])37513751- secy->replay_window = nla_get_u32(data[IFLA_MACSEC_WINDOW]);37523752-37533748 if (data[IFLA_MACSEC_ENCRYPT])37543749 tx_sc->encrypt = !!nla_get_u8(data[IFLA_MACSEC_ENCRYPT]);37553750···37923793 }37933794 }3794379537963796+ if (data[IFLA_MACSEC_WINDOW]) {37973797+ secy->replay_window = nla_get_u32(data[IFLA_MACSEC_WINDOW]);37983798+37993799+ /* IEEE 802.1AEbw-2013 10.7.8 - maximum replay window38003800+ * for XPN cipher suites */38013801+ if (secy->xpn &&38023802+ secy->replay_window > MACSEC_XPN_MAX_REPLAY_WINDOW)38033803+ return -EINVAL;38043804+ }38053805+37953806 return 0;37963807}37973808···3831382238323823 ret = macsec_changelink_common(dev, data);38333824 if (ret)38343834- return ret;38253825+ goto cleanup;3835382638363827 /* If h/w offloading is available, propagate to the device */38373828 if (macsec_is_offloaded(macsec)) {
+1-1
drivers/net/pcs/pcs-xpcs.c
···986986 */987987 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS);988988 if (ret < 0)989989- return false;989989+ return ret;990990991991 if (ret & DW_VR_MII_C37_ANSGM_SP_LNKSTS) {992992 int speed_value;
+1
drivers/net/sungem_phy.c
···450450 int can_low_power = 1;451451 if (np == NULL || of_get_property(np, "no-autolowpower", NULL))452452 can_low_power = 0;453453+ of_node_put(np);453454 if (can_low_power) {454455 /* Enable automatic low-power */455456 sungem_phy_write(phy, 0x1c, 0x9002);
+34-3
drivers/net/virtio_net.c
···242242 /* Packet virtio header size */243243 u8 hdr_len;244244245245- /* Work struct for refilling if we run low on memory. */245245+ /* Work struct for delayed refilling if we run low on memory. */246246 struct delayed_work refill;247247+248248+ /* Is delayed refill enabled? */249249+ bool refill_enabled;250250+251251+ /* The lock to synchronize the access to refill_enabled */252252+ spinlock_t refill_lock;247253248254 /* Work struct for config space updates */249255 struct work_struct config_work;···352346 } else353347 p = alloc_page(gfp_mask);354348 return p;349349+}350350+351351+static void enable_delayed_refill(struct virtnet_info *vi)352352+{353353+ spin_lock_bh(&vi->refill_lock);354354+ vi->refill_enabled = true;355355+ spin_unlock_bh(&vi->refill_lock);356356+}357357+358358+static void disable_delayed_refill(struct virtnet_info *vi)359359+{360360+ spin_lock_bh(&vi->refill_lock);361361+ vi->refill_enabled = false;362362+ spin_unlock_bh(&vi->refill_lock);355363}356364357365static void virtqueue_napi_schedule(struct napi_struct *napi,···15471527 }1548152815491529 if (rq->vq->num_free > min((unsigned int)budget, virtqueue_get_vring_size(rq->vq)) / 2) {15501550- if (!try_fill_recv(vi, rq, GFP_ATOMIC))15511551- schedule_delayed_work(&vi->refill, 0);15301530+ if (!try_fill_recv(vi, rq, GFP_ATOMIC)) {15311531+ spin_lock(&vi->refill_lock);15321532+ if (vi->refill_enabled)15331533+ schedule_delayed_work(&vi->refill, 0);15341534+ spin_unlock(&vi->refill_lock);15351535+ }15521536 }1553153715541538 u64_stats_update_begin(&rq->stats.syncp);···16741650{16751651 struct virtnet_info *vi = netdev_priv(dev);16761652 int i, err;16531653+16541654+ enable_delayed_refill(vi);1677165516781656 for (i = 0; i < vi->max_queue_pairs; i++) {16791657 if (i < vi->curr_queue_pairs)···20592033 struct virtnet_info *vi = netdev_priv(dev);20602034 int i;2061203520362036+ /* Make sure NAPI doesn't schedule refill work */20372037+ disable_delayed_refill(vi);20622038 /* Make sure refill_work doesn't re-enable napi! */20632039 cancel_delayed_work_sync(&vi->refill);20642040···2820279228212793 virtio_device_ready(vdev);2822279427952795+ enable_delayed_refill(vi);27962796+28232797 if (netif_running(vi->dev)) {28242798 err = virtnet_open(vi->dev);28252799 if (err)···35653535 vdev->priv = vi;3566353635673537 INIT_WORK(&vi->config_work, virtnet_config_changed_work);35383538+ spin_lock_init(&vi->refill_lock);3568353935693540 /* If we can receive ANY GSO packets, we must allocate large ones. */35703541 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) ||
+1-1
drivers/pinctrl/Kconfig
···3232 Say Y here to add some extra checks and diagnostics to PINCTRL calls.33333434config PINCTRL_AMD3535- tristate "AMD GPIO pin control"3535+ bool "AMD GPIO pin control"3636 depends on HAS_IOMEM3737 depends on ACPI || COMPILE_TEST3838 select GPIOLIB
+40-25
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
···102102 struct device *dev;103103 struct gpio_chip gpio_chip;104104 struct irq_chip irq_chip;105105- spinlock_t irq_lock;105105+ raw_spinlock_t irq_lock;106106 struct pinctrl_desc pctl;107107 struct pinctrl_dev *pctl_dev;108108 struct armada_37xx_pin_group *groups;···523523 unsigned long flags;524524525525 armada_37xx_irq_update_reg(®, d);526526- spin_lock_irqsave(&info->irq_lock, flags);526526+ raw_spin_lock_irqsave(&info->irq_lock, flags);527527 writel(d->mask, info->base + reg);528528- spin_unlock_irqrestore(&info->irq_lock, flags);528528+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);529529}530530531531static void armada_37xx_irq_mask(struct irq_data *d)···536536 unsigned long flags;537537538538 armada_37xx_irq_update_reg(®, d);539539- spin_lock_irqsave(&info->irq_lock, flags);539539+ raw_spin_lock_irqsave(&info->irq_lock, flags);540540 val = readl(info->base + reg);541541 writel(val & ~d->mask, info->base + reg);542542- spin_unlock_irqrestore(&info->irq_lock, flags);542542+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);543543}544544545545static void armada_37xx_irq_unmask(struct irq_data *d)···550550 unsigned long flags;551551552552 armada_37xx_irq_update_reg(®, d);553553- spin_lock_irqsave(&info->irq_lock, flags);553553+ raw_spin_lock_irqsave(&info->irq_lock, flags);554554 val = readl(info->base + reg);555555 writel(val | d->mask, info->base + reg);556556- spin_unlock_irqrestore(&info->irq_lock, flags);556556+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);557557}558558559559static int armada_37xx_irq_set_wake(struct irq_data *d, unsigned int on)···564564 unsigned long flags;565565566566 armada_37xx_irq_update_reg(®, d);567567- spin_lock_irqsave(&info->irq_lock, flags);567567+ raw_spin_lock_irqsave(&info->irq_lock, flags);568568 val = readl(info->base + reg);569569 if (on)570570 val |= (BIT(d->hwirq % GPIO_PER_REG));571571 else572572 val &= ~(BIT(d->hwirq % GPIO_PER_REG));573573 writel(val, info->base + reg);574574- spin_unlock_irqrestore(&info->irq_lock, flags);574574+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);575575576576 return 0;577577}···583583 u32 val, reg = IRQ_POL;584584 unsigned long flags;585585586586- spin_lock_irqsave(&info->irq_lock, flags);586586+ raw_spin_lock_irqsave(&info->irq_lock, flags);587587 armada_37xx_irq_update_reg(®, d);588588 val = readl(info->base + reg);589589 switch (type) {···607607 break;608608 }609609 default:610610- spin_unlock_irqrestore(&info->irq_lock, flags);610610+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);611611 return -EINVAL;612612 }613613 writel(val, info->base + reg);614614- spin_unlock_irqrestore(&info->irq_lock, flags);614614+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);615615616616 return 0;617617}···626626627627 regmap_read(info->regmap, INPUT_VAL + 4*reg_idx, &l);628628629629- spin_lock_irqsave(&info->irq_lock, flags);629629+ raw_spin_lock_irqsave(&info->irq_lock, flags);630630 p = readl(info->base + IRQ_POL + 4 * reg_idx);631631 if ((p ^ l) & (1 << bit_num)) {632632 /*···647647 ret = -1;648648 }649649650650- spin_unlock_irqrestore(&info->irq_lock, flags);650650+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);651651 return ret;652652}653653···664664 u32 status;665665 unsigned long flags;666666667667- spin_lock_irqsave(&info->irq_lock, flags);667667+ raw_spin_lock_irqsave(&info->irq_lock, flags);668668 status = readl_relaxed(info->base + IRQ_STATUS + 4 * i);669669 /* Manage only the interrupt that was enabled */670670 status &= readl_relaxed(info->base + IRQ_EN + 4 * i);671671- spin_unlock_irqrestore(&info->irq_lock, flags);671671+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);672672 while (status) {673673 u32 hwirq = ffs(status) - 1;674674 u32 virq = irq_find_mapping(d, hwirq +···695695696696update_status:697697 /* Update status in case a new IRQ appears */698698- spin_lock_irqsave(&info->irq_lock, flags);698698+ raw_spin_lock_irqsave(&info->irq_lock, flags);699699 status = readl_relaxed(info->base +700700 IRQ_STATUS + 4 * i);701701 /* Manage only the interrupt that was enabled */702702 status &= readl_relaxed(info->base + IRQ_EN + 4 * i);703703- spin_unlock_irqrestore(&info->irq_lock, flags);703703+ raw_spin_unlock_irqrestore(&info->irq_lock, flags);704704 }705705 }706706 chained_irq_exit(chip, desc);···731731 struct device *dev = &pdev->dev;732732 unsigned int i, nr_irq_parent;733733734734- spin_lock_init(&info->irq_lock);734734+ raw_spin_lock_init(&info->irq_lock);735735736736 nr_irq_parent = of_irq_count(np);737737 if (!nr_irq_parent) {···11071107 { },11081108};1109110911101110+static const struct regmap_config armada_37xx_pinctrl_regmap_config = {11111111+ .reg_bits = 32,11121112+ .val_bits = 32,11131113+ .reg_stride = 4,11141114+ .use_raw_spinlock = true,11151115+};11161116+11101117static int __init armada_37xx_pinctrl_probe(struct platform_device *pdev)11111118{11121119 struct armada_37xx_pinctrl *info;11131120 struct device *dev = &pdev->dev;11141114- struct device_node *np = dev->of_node;11151121 struct regmap *regmap;11221122+ void __iomem *base;11161123 int ret;11241124+11251125+ base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);11261126+ if (IS_ERR(base)) {11271127+ dev_err(dev, "failed to ioremap base address: %pe\n", base);11281128+ return PTR_ERR(base);11291129+ }11301130+11311131+ regmap = devm_regmap_init_mmio(dev, base,11321132+ &armada_37xx_pinctrl_regmap_config);11331133+ if (IS_ERR(regmap)) {11341134+ dev_err(dev, "failed to create regmap: %pe\n", regmap);11351135+ return PTR_ERR(regmap);11361136+ }1117113711181138 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);11191139 if (!info)11201140 return -ENOMEM;1121114111221142 info->dev = dev;11231123-11241124- regmap = syscon_node_to_regmap(np);11251125- if (IS_ERR(regmap))11261126- return dev_err_probe(dev, PTR_ERR(regmap), "cannot get regmap\n");11271143 info->regmap = regmap;11281128-11291144 info->data = of_device_get_match_data(dev);1130114511311146 ret = armada_37xx_pinctrl_register(pdev, info);
···871871 }872872873873 *map = kcalloc(*num_maps + nmG, sizeof(**map), GFP_KERNEL);874874+ if (*map == NULL)875875+ return -ENOMEM;876876+874877 for (i = 0; i < (*num_maps); i++) {875878 dt_pin = be32_to_cpu(list[i]);876879 pin_num = FIELD_GET(GENMASK(31, 24), dt_pin);
+1
drivers/ptp/Kconfig
···176176 depends on !S390177177 depends on COMMON_CLK178178 select NET_DEVLINK179179+ select CRC16179180 help180181 This driver adds support for an OpenCompute time card.181182
+1-1
drivers/s390/net/qeth_core_main.c
···35653565 if (!atomic_read(&queue->set_pci_flags_count)) {35663566 /*35673567 * there's no outstanding PCI any more, so we35683568- * have to request a PCI to be sure the the PCI35683568+ * have to request a PCI to be sure the PCI35693569 * will wake at some time in the future then we35703570 * can flush packed buffers that might still be35713571 * hanging around, which can happen if no
+8-4
drivers/spi/spi-bcm2835.c
···11381138 struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);1139113911401140 /* if an error occurred and we have an active dma, then terminate */11411141- dmaengine_terminate_sync(ctlr->dma_tx);11421142- bs->tx_dma_active = false;11431143- dmaengine_terminate_sync(ctlr->dma_rx);11441144- bs->rx_dma_active = false;11411141+ if (ctlr->dma_tx) {11421142+ dmaengine_terminate_sync(ctlr->dma_tx);11431143+ bs->tx_dma_active = false;11441144+ }11451145+ if (ctlr->dma_rx) {11461146+ dmaengine_terminate_sync(ctlr->dma_rx);11471147+ bs->rx_dma_active = false;11481148+ }11451149 bcm2835_spi_undo_prologue(bs);1146115011471151 /* and reset */
+1-1
drivers/spi/spi-cadence.c
···6969#define CDNS_SPI_BAUD_DIV_SHIFT 3 /* Baud rate divisor shift in CR */7070#define CDNS_SPI_SS_SHIFT 10 /* Slave Select field shift in CR */7171#define CDNS_SPI_SS0 0x1 /* Slave Select zero */7272-#define CDNS_SPI_NOSS 0x3C /* No Slave select */7272+#define CDNS_SPI_NOSS 0xF /* No Slave select */73737474/*7575 * SPI Interrupt Registers bit Masks
+4
drivers/spi/spi-rspi.c
···613613 rspi->dma_callbacked, HZ);614614 if (ret > 0 && rspi->dma_callbacked) {615615 ret = 0;616616+ if (tx)617617+ dmaengine_synchronize(rspi->ctlr->dma_tx);618618+ if (rx)619619+ dmaengine_synchronize(rspi->ctlr->dma_rx);616620 } else {617621 if (!ret) {618622 dev_err(&rspi->ctlr->dev, "DMA timeout\n");
···17381738 return;1739173917401740 /*17411741+ * READV uses fields in `struct io_rw` (len/addr) to stash the selected17421742+ * buffer data. However if that buffer is recycled the original request17431743+ * data stored in addr is lost. Therefore forbid recycling for now.17441744+ */17451745+ if (req->opcode == IORING_OP_READV)17461746+ return;17471747+17481748+ /*17411749 * We don't need to recycle for REQ_F_BUFFER_RING, we can just clear17421750 * the flag and hence ensure that bl->head doesn't get incremented.17431751 * If the tail has already been incremented, hang on to it.···1293912931{1294012932 struct io_uring_buf_ring *br;1294112933 struct io_uring_buf_reg reg;1294212942- struct io_buffer_list *bl;1293412934+ struct io_buffer_list *bl, *free_bl = NULL;1294312935 struct page **pages;1294412936 int nr_pages;1294512937···1297112963 if (bl->buf_nr_pages || !list_empty(&bl->buf_list))1297212964 return -EEXIST;1297312965 } else {1297412974- bl = kzalloc(sizeof(*bl), GFP_KERNEL);1296612966+ free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL);1297512967 if (!bl)1297612968 return -ENOMEM;1297712969 }···1298012972 struct_size(br, bufs, reg.ring_entries),1298112973 &nr_pages);1298212974 if (IS_ERR(pages)) {1298312983- kfree(bl);1297512975+ kfree(free_bl);1298412976 return PTR_ERR(pages);1298512977 }1298612978
···277277 OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT = 1 << 15, /* Journal Async Commit */278278 OCFS2_MOUNT_ERRORS_CONT = 1 << 16, /* Return EIO to the calling process on error */279279 OCFS2_MOUNT_ERRORS_ROFS = 1 << 17, /* Change filesystem to read-only on error */280280- OCFS2_MOUNT_NOCLUSTER = 1 << 18, /* No cluster aware filesystem mount */281280};282281283282#define OCFS2_OSB_SOFT_RO 0x0001···672673673674static inline int ocfs2_mount_local(struct ocfs2_super *osb)674675{675675- return ((osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT)676676- || (osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER));676676+ return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT);677677}678678679679static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
+19-27
fs/ocfs2/slot_map.c
···252252 int i, ret = -ENOSPC;253253254254 if ((preferred >= 0) && (preferred < si->si_num_slots)) {255255- if (!si->si_slots[preferred].sl_valid ||256256- !si->si_slots[preferred].sl_node_num) {255255+ if (!si->si_slots[preferred].sl_valid) {257256 ret = preferred;258257 goto out;259258 }260259 }261260262261 for(i = 0; i < si->si_num_slots; i++) {263263- if (!si->si_slots[i].sl_valid ||264264- !si->si_slots[i].sl_node_num) {262262+ if (!si->si_slots[i].sl_valid) {265263 ret = i;266264 break;267265 }···454456 spin_lock(&osb->osb_lock);455457 ocfs2_update_slot_info(si);456458457457- if (ocfs2_mount_local(osb))458458- /* use slot 0 directly in local mode */459459- slot = 0;460460- else {461461- /* search for ourselves first and take the slot if it already462462- * exists. Perhaps we need to mark this in a variable for our463463- * own journal recovery? Possibly not, though we certainly464464- * need to warn to the user */465465- slot = __ocfs2_node_num_to_slot(si, osb->node_num);459459+ /* search for ourselves first and take the slot if it already460460+ * exists. Perhaps we need to mark this in a variable for our461461+ * own journal recovery? Possibly not, though we certainly462462+ * need to warn to the user */463463+ slot = __ocfs2_node_num_to_slot(si, osb->node_num);464464+ if (slot < 0) {465465+ /* if no slot yet, then just take 1st available466466+ * one. */467467+ slot = __ocfs2_find_empty_slot(si, osb->preferred_slot);466468 if (slot < 0) {467467- /* if no slot yet, then just take 1st available468468- * one. */469469- slot = __ocfs2_find_empty_slot(si, osb->preferred_slot);470470- if (slot < 0) {471471- spin_unlock(&osb->osb_lock);472472- mlog(ML_ERROR, "no free slots available!\n");473473- status = -EINVAL;474474- goto bail;475475- }476476- } else477477- printk(KERN_INFO "ocfs2: Slot %d on device (%s) was "478478- "already allocated to this node!\n",479479- slot, osb->dev_str);480480- }469469+ spin_unlock(&osb->osb_lock);470470+ mlog(ML_ERROR, "no free slots available!\n");471471+ status = -EINVAL;472472+ goto bail;473473+ }474474+ } else475475+ printk(KERN_INFO "ocfs2: Slot %d on device (%s) was already "476476+ "allocated to this node!\n", slot, osb->dev_str);481477482478 ocfs2_set_slot(si, slot, osb->node_num);483479 osb->slot_num = slot;
···28232823{28242824 /* Does this proto have per netns sysctl_wmem ? */28252825 if (proto->sysctl_wmem_offset)28262826- return *(int *)((void *)sock_net(sk) + proto->sysctl_wmem_offset);28262826+ return READ_ONCE(*(int *)((void *)sock_net(sk) + proto->sysctl_wmem_offset));2827282728282828- return *proto->sysctl_wmem;28282828+ return READ_ONCE(*proto->sysctl_wmem);28292829}2830283028312831static inline int sk_get_rmem0(const struct sock *sk, const struct proto *proto)28322832{28332833 /* Does this proto have per netns sysctl_rmem ? */28342834 if (proto->sysctl_rmem_offset)28352835- return *(int *)((void *)sock_net(sk) + proto->sysctl_rmem_offset);28352835+ return READ_ONCE(*(int *)((void *)sock_net(sk) + proto->sysctl_rmem_offset));2836283628372837- return *proto->sysctl_rmem;28372837+ return READ_ONCE(*proto->sysctl_rmem);28382838}2839283928402840/* Default TCP Small queue budget is ~1 ms of data (1sec >> 10)
+1-1
include/net/tcp.h
···1425142514261426static inline int tcp_win_from_space(const struct sock *sk, int space)14271427{14281428- int tcp_adv_win_scale = sock_net(sk)->ipv4.sysctl_tcp_adv_win_scale;14281428+ int tcp_adv_win_scale = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_adv_win_scale);1429142914301430 return tcp_adv_win_scale <= 0 ?14311431 (space>>(-tcp_adv_win_scale)) :
+2
include/uapi/asm-generic/fcntl.h
···192192193193#define F_LINUX_SPECIFIC_BASE 1024194194195195+#ifndef HAVE_ARCH_STRUCT_FLOCK195196struct flock {196197 short l_type;197198 short l_whence;···217216 __ARCH_FLOCK64_PAD218217#endif219218};219219+#endif /* HAVE_ARCH_STRUCT_FLOCK */220220221221#endif /* _ASM_GENERIC_FCNTL_H */
···511511 return sum;512512}513513514514-#define SRCU_INTERVAL 1 // Base delay if no expedited GPs pending.515515-#define SRCU_MAX_INTERVAL 10 // Maximum incremental delay from slow readers.516516-#define SRCU_MAX_NODELAY_PHASE 1 // Maximum per-GP-phase consecutive no-delay instances.517517-#define SRCU_MAX_NODELAY 100 // Maximum consecutive no-delay instances.514514+/*515515+ * We use an adaptive strategy for synchronize_srcu() and especially for516516+ * synchronize_srcu_expedited(). We spin for a fixed time period517517+ * (defined below, boot time configurable) to allow SRCU readers to exit518518+ * their read-side critical sections. If there are still some readers519519+ * after one jiffy, we repeatedly block for one jiffy time periods.520520+ * The blocking time is increased as the grace-period age increases,521521+ * with max blocking time capped at 10 jiffies.522522+ */523523+#define SRCU_DEFAULT_RETRY_CHECK_DELAY 5524524+525525+static ulong srcu_retry_check_delay = SRCU_DEFAULT_RETRY_CHECK_DELAY;526526+module_param(srcu_retry_check_delay, ulong, 0444);527527+528528+#define SRCU_INTERVAL 1 // Base delay if no expedited GPs pending.529529+#define SRCU_MAX_INTERVAL 10 // Maximum incremental delay from slow readers.530530+531531+#define SRCU_DEFAULT_MAX_NODELAY_PHASE_LO 3UL // Lowmark on default per-GP-phase532532+ // no-delay instances.533533+#define SRCU_DEFAULT_MAX_NODELAY_PHASE_HI 1000UL // Highmark on default per-GP-phase534534+ // no-delay instances.535535+536536+#define SRCU_UL_CLAMP_LO(val, low) ((val) > (low) ? (val) : (low))537537+#define SRCU_UL_CLAMP_HI(val, high) ((val) < (high) ? (val) : (high))538538+#define SRCU_UL_CLAMP(val, low, high) SRCU_UL_CLAMP_HI(SRCU_UL_CLAMP_LO((val), (low)), (high))539539+// per-GP-phase no-delay instances adjusted to allow non-sleeping poll upto540540+// one jiffies time duration. Mult by 2 is done to factor in the srcu_get_delay()541541+// called from process_srcu().542542+#define SRCU_DEFAULT_MAX_NODELAY_PHASE_ADJUSTED \543543+ (2UL * USEC_PER_SEC / HZ / SRCU_DEFAULT_RETRY_CHECK_DELAY)544544+545545+// Maximum per-GP-phase consecutive no-delay instances.546546+#define SRCU_DEFAULT_MAX_NODELAY_PHASE \547547+ SRCU_UL_CLAMP(SRCU_DEFAULT_MAX_NODELAY_PHASE_ADJUSTED, \548548+ SRCU_DEFAULT_MAX_NODELAY_PHASE_LO, \549549+ SRCU_DEFAULT_MAX_NODELAY_PHASE_HI)550550+551551+static ulong srcu_max_nodelay_phase = SRCU_DEFAULT_MAX_NODELAY_PHASE;552552+module_param(srcu_max_nodelay_phase, ulong, 0444);553553+554554+// Maximum consecutive no-delay instances.555555+#define SRCU_DEFAULT_MAX_NODELAY (SRCU_DEFAULT_MAX_NODELAY_PHASE > 100 ? \556556+ SRCU_DEFAULT_MAX_NODELAY_PHASE : 100)557557+558558+static ulong srcu_max_nodelay = SRCU_DEFAULT_MAX_NODELAY;559559+module_param(srcu_max_nodelay, ulong, 0444);518560519561/*520562 * Return grace-period delay, zero if there are expedited grace···564522 */565523static unsigned long srcu_get_delay(struct srcu_struct *ssp)566524{525525+ unsigned long gpstart;526526+ unsigned long j;567527 unsigned long jbase = SRCU_INTERVAL;568528569529 if (ULONG_CMP_LT(READ_ONCE(ssp->srcu_gp_seq), READ_ONCE(ssp->srcu_gp_seq_needed_exp)))570530 jbase = 0;571571- if (rcu_seq_state(READ_ONCE(ssp->srcu_gp_seq)))572572- jbase += jiffies - READ_ONCE(ssp->srcu_gp_start);573573- if (!jbase) {574574- WRITE_ONCE(ssp->srcu_n_exp_nodelay, READ_ONCE(ssp->srcu_n_exp_nodelay) + 1);575575- if (READ_ONCE(ssp->srcu_n_exp_nodelay) > SRCU_MAX_NODELAY_PHASE)576576- jbase = 1;531531+ if (rcu_seq_state(READ_ONCE(ssp->srcu_gp_seq))) {532532+ j = jiffies - 1;533533+ gpstart = READ_ONCE(ssp->srcu_gp_start);534534+ if (time_after(j, gpstart))535535+ jbase += j - gpstart;536536+ if (!jbase) {537537+ WRITE_ONCE(ssp->srcu_n_exp_nodelay, READ_ONCE(ssp->srcu_n_exp_nodelay) + 1);538538+ if (READ_ONCE(ssp->srcu_n_exp_nodelay) > srcu_max_nodelay_phase)539539+ jbase = 1;540540+ }577541 }578542 return jbase > SRCU_MAX_INTERVAL ? SRCU_MAX_INTERVAL : jbase;579543}···653605 this_cpu_inc(ssp->sda->srcu_unlock_count[idx]);654606}655607EXPORT_SYMBOL_GPL(__srcu_read_unlock);656656-657657-/*658658- * We use an adaptive strategy for synchronize_srcu() and especially for659659- * synchronize_srcu_expedited(). We spin for a fixed time period660660- * (defined below) to allow SRCU readers to exit their read-side critical661661- * sections. If there are still some readers after a few microseconds,662662- * we repeatedly block for 1-millisecond time periods.663663- */664664-#define SRCU_RETRY_CHECK_DELAY 5665608666609/*667610 * Start an SRCU grace period.···739700 */740701static void srcu_gp_end(struct srcu_struct *ssp)741702{742742- unsigned long cbdelay;703703+ unsigned long cbdelay = 1;743704 bool cbs;744705 bool last_lvl;745706 int cpu;···759720 spin_lock_irq_rcu_node(ssp);760721 idx = rcu_seq_state(ssp->srcu_gp_seq);761722 WARN_ON_ONCE(idx != SRCU_STATE_SCAN2);762762- cbdelay = !!srcu_get_delay(ssp);723723+ if (ULONG_CMP_LT(READ_ONCE(ssp->srcu_gp_seq), READ_ONCE(ssp->srcu_gp_seq_needed_exp)))724724+ cbdelay = 0;725725+763726 WRITE_ONCE(ssp->srcu_last_gp_end, ktime_get_mono_fast_ns());764727 rcu_seq_end(&ssp->srcu_gp_seq);765728 gpseq = rcu_seq_current(&ssp->srcu_gp_seq);···962921 */963922static bool try_check_zero(struct srcu_struct *ssp, int idx, int trycount)964923{924924+ unsigned long curdelay;925925+926926+ curdelay = !srcu_get_delay(ssp);927927+965928 for (;;) {966929 if (srcu_readers_active_idx_check(ssp, idx))967930 return true;968968- if (--trycount + !srcu_get_delay(ssp) <= 0)931931+ if ((--trycount + curdelay) <= 0)969932 return false;970970- udelay(SRCU_RETRY_CHECK_DELAY);933933+ udelay(srcu_retry_check_delay);971934 }972935}973936···16271582 j = jiffies;16281583 if (READ_ONCE(ssp->reschedule_jiffies) == j) {16291584 WRITE_ONCE(ssp->reschedule_count, READ_ONCE(ssp->reschedule_count) + 1);16301630- if (READ_ONCE(ssp->reschedule_count) > SRCU_MAX_NODELAY)15851585+ if (READ_ONCE(ssp->reschedule_count) > srcu_max_nodelay)16311586 curdelay = 1;16321587 } else {16331588 WRITE_ONCE(ssp->reschedule_count, 1);···17191674 pr_info("Hierarchical SRCU implementation.\n");17201675 if (exp_holdoff != DEFAULT_SRCU_EXP_HOLDOFF)17211676 pr_info("\tNon-default auto-expedite holdoff of %lu ns.\n", exp_holdoff);16771677+ if (srcu_retry_check_delay != SRCU_DEFAULT_RETRY_CHECK_DELAY)16781678+ pr_info("\tNon-default retry check delay of %lu us.\n", srcu_retry_check_delay);16791679+ if (srcu_max_nodelay != SRCU_DEFAULT_MAX_NODELAY)16801680+ pr_info("\tNon-default max no-delay of %lu.\n", srcu_max_nodelay);16811681+ pr_info("\tMax phase no-delay instances is %lu.\n", srcu_max_nodelay_phase);17221682 return 0;17231683}17241684early_initcall(srcu_bootup_announce);
+4-1
kernel/sched/deadline.c
···17011701 * the throttle.17021702 */17031703 p->dl.dl_throttled = 0;17041704- BUG_ON(!is_dl_boosted(&p->dl) || flags != ENQUEUE_REPLENISH);17041704+ if (!(flags & ENQUEUE_REPLENISH))17051705+ printk_deferred_once("sched: DL de-boosted task PID %d: REPLENISH flag missing\n",17061706+ task_pid_nr(p));17071707+17051708 return;17061709 }17071710
···8787 * belongs to this folio.8888 */8989 if (unlikely(page_folio(page) != folio)) {9090- folio_put_refs(folio, refs);9090+ if (!put_devmap_managed_page_refs(&folio->page, refs))9191+ folio_put_refs(folio, refs);9192 goto retry;9293 }9394···177176 refs *= GUP_PIN_COUNTING_BIAS;178177 }179178180180- folio_put_refs(folio, refs);179179+ if (!put_devmap_managed_page_refs(&folio->page, refs))180180+ folio_put_refs(folio, refs);181181}182182183183/**
+8-2
mm/hugetlb.c
···47884788 * sharing with another vma.47894789 */47904790 ;47914791- } else if (unlikely(is_hugetlb_entry_migration(entry) ||47924792- is_hugetlb_entry_hwpoisoned(entry))) {47914791+ } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) {47924792+ bool uffd_wp = huge_pte_uffd_wp(entry);47934793+47944794+ if (!userfaultfd_wp(dst_vma) && uffd_wp)47954795+ entry = huge_pte_clear_uffd_wp(entry);47964796+ set_huge_pte_at(dst, addr, dst_pte, entry);47974797+ } else if (unlikely(is_hugetlb_entry_migration(entry))) {47934798 swp_entry_t swp_entry = pte_to_swp_entry(entry);47944799 bool uffd_wp = huge_pte_uffd_wp(entry);47954800···5952594759535948 page = alloc_huge_page(dst_vma, dst_addr, 0);59545949 if (IS_ERR(page)) {59505950+ put_page(*pagep);59555951 ret = -ENOMEM;59565952 *pagep = NULL;59575953 goto out;
+9-9
mm/kfence/core.c
···603603 addr += 2 * PAGE_SIZE;604604 }605605606606- /*607607- * The pool is live and will never be deallocated from this point on.608608- * Remove the pool object from the kmemleak object tree, as it would609609- * otherwise overlap with allocations returned by kfence_alloc(), which610610- * are registered with kmemleak through the slab post-alloc hook.611611- */612612- kmemleak_free(__kfence_pool);613613-614606 return 0;615607}616608···615623616624 addr = kfence_init_pool();617625618618- if (!addr)626626+ if (!addr) {627627+ /*628628+ * The pool is live and will never be deallocated from this point on.629629+ * Ignore the pool object from the kmemleak phys object tree, as it would630630+ * otherwise overlap with allocations returned by kfence_alloc(), which631631+ * are registered with kmemleak through the slab post-alloc hook.632632+ */633633+ kmemleak_ignore_phys(__pa(__kfence_pool));619634 return true;635635+ }620636621637 /*622638 * Only release unprotected pages, and do not try to go back and change
+6-3
mm/memory.c
···30433043 pte_t entry;3044304430453045 VM_BUG_ON(!(vmf->flags & FAULT_FLAG_WRITE));30463046- VM_BUG_ON(PageAnon(page) && !PageAnonExclusive(page));30463046+ VM_BUG_ON(page && PageAnon(page) && !PageAnonExclusive(page));3047304730483048 /*30493049 * Clear the pages cpupid information as the existing···43694369 return VM_FAULT_OOM;43704370 }4371437143724372- /* See comment in handle_pte_fault() */43724372+ /*43734373+ * See comment in handle_pte_fault() for how this scenario happens, we43744374+ * need to return NOPAGE so that we drop this page.43754375+ */43734376 if (pmd_devmap_trans_unstable(vmf->pmd))43744374- return 0;43774377+ return VM_FAULT_NOPAGE;4375437843764379 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,43774380 vmf->address, &vmf->ptl);
+3-3
mm/memremap.c
···499499}500500501501#ifdef CONFIG_FS_DAX502502-bool __put_devmap_managed_page(struct page *page)502502+bool __put_devmap_managed_page_refs(struct page *page, int refs)503503{504504 if (page->pgmap->type != MEMORY_DEVICE_FS_DAX)505505 return false;···509509 * refcount is 1, then the page is free and the refcount is510510 * stable because nobody holds a reference on the page.511511 */512512- if (page_ref_dec_return(page) == 1)512512+ if (page_ref_sub_return(page, refs) == 1)513513 wake_up_var(&page->_refcount);514514 return true;515515}516516-EXPORT_SYMBOL(__put_devmap_managed_page);516516+EXPORT_SYMBOL(__put_devmap_managed_page_refs);517517#endif /* CONFIG_FS_DAX */
+26-7
mm/secretmem.c
···5555 gfp_t gfp = vmf->gfp_mask;5656 unsigned long addr;5757 struct page *page;5858+ vm_fault_t ret;5859 int err;59606061 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))6162 return vmf_error(-EINVAL);62636464+ filemap_invalidate_lock_shared(mapping);6565+6366retry:6467 page = find_lock_page(mapping, offset);6568 if (!page) {6669 page = alloc_page(gfp | __GFP_ZERO);6767- if (!page)6868- return VM_FAULT_OOM;7070+ if (!page) {7171+ ret = VM_FAULT_OOM;7272+ goto out;7373+ }69747075 err = set_direct_map_invalid_noflush(page);7176 if (err) {7277 put_page(page);7373- return vmf_error(err);7878+ ret = vmf_error(err);7979+ goto out;7480 }75817682 __SetPageUptodate(page);···9286 if (err == -EEXIST)9387 goto retry;94889595- return vmf_error(err);8989+ ret = vmf_error(err);9090+ goto out;9691 }97929893 addr = (unsigned long)page_address(page);···10194 }1029510396 vmf->page = page;104104- return VM_FAULT_LOCKED;9797+ ret = VM_FAULT_LOCKED;9898+9999+out:100100+ filemap_invalidate_unlock_shared(mapping);101101+ return ret;105102}106103107104static const struct vm_operations_struct secretmem_vm_ops = {···173162 struct dentry *dentry, struct iattr *iattr)174163{175164 struct inode *inode = d_inode(dentry);165165+ struct address_space *mapping = inode->i_mapping;176166 unsigned int ia_valid = iattr->ia_valid;167167+ int ret;168168+169169+ filemap_invalidate_lock(mapping);177170178171 if ((ia_valid & ATTR_SIZE) && inode->i_size)179179- return -EINVAL;172172+ ret = -EINVAL;173173+ else174174+ ret = simple_setattr(mnt_userns, dentry, iattr);180175181181- return simple_setattr(mnt_userns, dentry, iattr);176176+ filemap_invalidate_unlock(mapping);177177+178178+ return ret;182179}183180184181static const struct inode_operations secretmem_iops = {
+2-5
mm/shmem.c
···33923392 break;33933393 case Opt_nr_blocks:33943394 ctx->blocks = memparse(param->string, &rest);33953395- if (*rest)33953395+ if (*rest || ctx->blocks > S64_MAX)33963396 goto bad_value;33973397 ctx->seen |= SHMEM_SEEN_BLOCKS;33983398 break;···3514351435153515 raw_spin_lock(&sbinfo->stat_lock);35163516 inodes = sbinfo->max_inodes - sbinfo->free_inodes;35173517- if (ctx->blocks > S64_MAX) {35183518- err = "Number of blocks too large";35193519- goto out;35203520- }35173517+35213518 if ((ctx->seen & SHMEM_SEEN_BLOCKS) && ctx->blocks) {35223519 if (!sbinfo->max_blocks) {35233520 err = "Cannot retroactively limit size";
+3-3
net/bluetooth/hci_sync.c
···52975297 return err;52985298 }5299529953005300+ /* Update event mask so only the allowed event can wakeup the host */53015301+ hci_set_event_mask_sync(hdev);53025302+53005303 /* Only configure accept list if disconnect succeeded and wake53015304 * isn't being prevented.53025305 */···5310530753115308 /* Unpause to take care of updating scanning params */53125309 hdev->scanning_paused = false;53135313-53145314- /* Update event mask so only the allowed event can wakeup the host */53155315- hci_set_event_mask_sync(hdev);5316531053175311 /* Enable event filter for paired devices */53185312 hci_update_event_filter_sync(hdev);
+48-13
net/bluetooth/l2cap_core.c
···111111}112112113113/* Find channel with given SCID.114114- * Returns locked channel. */114114+ * Returns a reference locked channel.115115+ */115116static struct l2cap_chan *l2cap_get_chan_by_scid(struct l2cap_conn *conn,116117 u16 cid)117118{···120119121120 mutex_lock(&conn->chan_lock);122121 c = __l2cap_get_chan_by_scid(conn, cid);123123- if (c)124124- l2cap_chan_lock(c);122122+ if (c) {123123+ /* Only lock if chan reference is not 0 */124124+ c = l2cap_chan_hold_unless_zero(c);125125+ if (c)126126+ l2cap_chan_lock(c);127127+ }125128 mutex_unlock(&conn->chan_lock);126129127130 return c;128131}129132130133/* Find channel with given DCID.131131- * Returns locked channel.134134+ * Returns a reference locked channel.132135 */133136static struct l2cap_chan *l2cap_get_chan_by_dcid(struct l2cap_conn *conn,134137 u16 cid)···141136142137 mutex_lock(&conn->chan_lock);143138 c = __l2cap_get_chan_by_dcid(conn, cid);144144- if (c)145145- l2cap_chan_lock(c);139139+ if (c) {140140+ /* Only lock if chan reference is not 0 */141141+ c = l2cap_chan_hold_unless_zero(c);142142+ if (c)143143+ l2cap_chan_lock(c);144144+ }146145 mutex_unlock(&conn->chan_lock);147146148147 return c;···171162172163 mutex_lock(&conn->chan_lock);173164 c = __l2cap_get_chan_by_ident(conn, ident);174174- if (c)175175- l2cap_chan_lock(c);165165+ if (c) {166166+ /* Only lock if chan reference is not 0 */167167+ c = l2cap_chan_hold_unless_zero(c);168168+ if (c)169169+ l2cap_chan_lock(c);170170+ }176171 mutex_unlock(&conn->chan_lock);177172178173 return c;···508495 BT_DBG("chan %p orig refcnt %u", c, kref_read(&c->kref));509496510497 kref_get(&c->kref);498498+}499499+500500+struct l2cap_chan *l2cap_chan_hold_unless_zero(struct l2cap_chan *c)501501+{502502+ BT_DBG("chan %p orig refcnt %u", c, kref_read(&c->kref));503503+504504+ if (!kref_get_unless_zero(&c->kref))505505+ return NULL;506506+507507+ return c;511508}512509513510void l2cap_chan_put(struct l2cap_chan *c)···19921969 src_match = !bacmp(&c->src, src);19931970 dst_match = !bacmp(&c->dst, dst);19941971 if (src_match && dst_match) {19951995- l2cap_chan_hold(c);19721972+ c = l2cap_chan_hold_unless_zero(c);19731973+ if (!c)19741974+ continue;19751975+19961976 read_unlock(&chan_list_lock);19971977 return c;19981978 }···20101984 }2011198520121986 if (c1)20132013- l2cap_chan_hold(c1);19871987+ c1 = l2cap_chan_hold_unless_zero(c1);2014198820151989 read_unlock(&chan_list_lock);20161990···4490446444914465unlock:44924466 l2cap_chan_unlock(chan);44674467+ l2cap_chan_put(chan);44934468 return err;44944469}44954470···4605457846064579done:46074580 l2cap_chan_unlock(chan);45814581+ l2cap_chan_put(chan);46084582 return err;46094583}46104584···53335305 l2cap_send_move_chan_rsp(chan, result);5334530653355307 l2cap_chan_unlock(chan);53085308+ l2cap_chan_put(chan);5336530953375310 return 0;53385311}···54265397 }5427539854285399 l2cap_chan_unlock(chan);54005400+ l2cap_chan_put(chan);54295401}5430540254315403static void l2cap_move_fail(struct l2cap_conn *conn, u8 ident, u16 icid,···54565426 l2cap_send_move_chan_cfm(chan, L2CAP_MC_UNCONFIRMED);5457542754585428 l2cap_chan_unlock(chan);54295429+ l2cap_chan_put(chan);54595430}5460543154615432static int l2cap_move_channel_rsp(struct l2cap_conn *conn,···55205489 l2cap_send_move_chan_cfm_rsp(conn, cmd->ident, icid);5521549055225491 l2cap_chan_unlock(chan);54925492+ l2cap_chan_put(chan);5523549355245494 return 0;55255495}···55565524 }5557552555585526 l2cap_chan_unlock(chan);55275527+ l2cap_chan_put(chan);5559552855605529 return 0;55615530}···59295896 if (credits > max_credits) {59305897 BT_ERR("LE credits overflow");59315898 l2cap_send_disconn_req(chan, ECONNRESET);59325932- l2cap_chan_unlock(chan);5933589959345900 /* Return 0 so that we don't trigger an unnecessary59355901 * command reject packet.59365902 */59375937- return 0;59035903+ goto unlock;59385904 }5939590559405906 chan->tx_credits += credits;···59445912 if (chan->tx_credits)59455913 chan->ops->resume(chan);5946591459155915+unlock:59475916 l2cap_chan_unlock(chan);59175917+ l2cap_chan_put(chan);5948591859495919 return 0;59505920}···7632759876337599done:76347600 l2cap_chan_unlock(chan);76017601+ l2cap_chan_put(chan);76357602}7636760376377604static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm,···81218086 if (src_type != c->src_type)81228087 continue;8123808881248124- l2cap_chan_hold(c);80898089+ c = l2cap_chan_hold_unless_zero(c);81258090 read_unlock(&chan_list_lock);81268091 return c;81278092 }
···1042104210431043void fib_alias_hw_flags_set(struct net *net, const struct fib_rt_info *fri)10441044{10451045+ u8 fib_notify_on_flag_change;10451046 struct fib_alias *fa_match;10461047 struct sk_buff *skb;10471048 int err;···10641063 WRITE_ONCE(fa_match->offload, fri->offload);10651064 WRITE_ONCE(fa_match->trap, fri->trap);1066106510661066+ fib_notify_on_flag_change = READ_ONCE(net->ipv4.sysctl_fib_notify_on_flag_change);10671067+10671068 /* 2 means send notifications only if offload_failed was changed. */10681068- if (net->ipv4.sysctl_fib_notify_on_flag_change == 2 &&10691069+ if (fib_notify_on_flag_change == 2 &&10691070 READ_ONCE(fa_match->offload_failed) == fri->offload_failed)10701071 goto out;1071107210721073 WRITE_ONCE(fa_match->offload_failed, fri->offload_failed);1073107410741074- if (!net->ipv4.sysctl_fib_notify_on_flag_change)10751075+ if (!fib_notify_on_flag_change)10751076 goto out;1076107710771078 skb = nlmsg_new(fib_nlmsg_size(fa_match->fa_info), GFP_ATOMIC);
+16-7
net/ipv4/tcp.c
···454454455455 icsk->icsk_sync_mss = tcp_sync_mss;456456457457- WRITE_ONCE(sk->sk_sndbuf, sock_net(sk)->ipv4.sysctl_tcp_wmem[1]);458458- WRITE_ONCE(sk->sk_rcvbuf, sock_net(sk)->ipv4.sysctl_tcp_rmem[1]);457457+ WRITE_ONCE(sk->sk_sndbuf, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[1]));458458+ WRITE_ONCE(sk->sk_rcvbuf, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[1]));459459460460 sk_sockets_allocated_inc(sk);461461}···688688 int size_goal)689689{690690 return skb->len < size_goal &&691691- sock_net(sk)->ipv4.sysctl_tcp_autocorking &&691691+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_autocorking) &&692692 !tcp_rtx_queue_empty(sk) &&693693 refcount_read(&sk->sk_wmem_alloc) > skb->truesize &&694694 tcp_skb_can_collapse_to(skb);···18421842 if (sk->sk_userlocks & SOCK_RCVBUF_LOCK)18431843 cap = sk->sk_rcvbuf >> 1;18441844 else18451845- cap = sock_net(sk)->ipv4.sysctl_tcp_rmem[2] >> 1;18451845+ cap = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]) >> 1;18461846 val = min(val, cap);18471847 WRITE_ONCE(sk->sk_rcvlowat, val ? : 1);18481848···45734573 return SKB_DROP_REASON_TCP_MD5UNEXPECTED;45744574 }4575457545764576- /* check the signature */45774577- genhash = tp->af_specific->calc_md5_hash(newhash, hash_expected,45784578- NULL, skb);45764576+ /* Check the signature.45774577+ * To support dual stack listeners, we need to handle45784578+ * IPv4-mapped case.45794579+ */45804580+ if (family == AF_INET)45814581+ genhash = tcp_v4_md5_hash_skb(newhash,45824582+ hash_expected,45834583+ NULL, skb);45844584+ else45854585+ genhash = tp->af_specific->calc_md5_hash(newhash,45864586+ hash_expected,45874587+ NULL, skb);4579458845804589 if (genhash || memcmp(hash_location, newhash, 16) != 0) {45814590 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5FAILURE);
+22-19
net/ipv4/tcp_input.c
···426426427427 if (sk->sk_sndbuf < sndmem)428428 WRITE_ONCE(sk->sk_sndbuf,429429- min(sndmem, sock_net(sk)->ipv4.sysctl_tcp_wmem[2]));429429+ min(sndmem, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[2])));430430}431431432432/* 2. Tuning advertised window (window_clamp, rcv_ssthresh)···461461 struct tcp_sock *tp = tcp_sk(sk);462462 /* Optimize this! */463463 int truesize = tcp_win_from_space(sk, skbtruesize) >> 1;464464- int window = tcp_win_from_space(sk, sock_net(sk)->ipv4.sysctl_tcp_rmem[2]) >> 1;464464+ int window = tcp_win_from_space(sk, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2])) >> 1;465465466466 while (tp->rcv_ssthresh <= window) {467467 if (truesize <= skb->len)···534534 */535535static void tcp_init_buffer_space(struct sock *sk)536536{537537- int tcp_app_win = sock_net(sk)->ipv4.sysctl_tcp_app_win;537537+ int tcp_app_win = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_app_win);538538 struct tcp_sock *tp = tcp_sk(sk);539539 int maxwin;540540···574574 struct tcp_sock *tp = tcp_sk(sk);575575 struct inet_connection_sock *icsk = inet_csk(sk);576576 struct net *net = sock_net(sk);577577+ int rmem2;577578578579 icsk->icsk_ack.quick = 0;580580+ rmem2 = READ_ONCE(net->ipv4.sysctl_tcp_rmem[2]);579581580580- if (sk->sk_rcvbuf < net->ipv4.sysctl_tcp_rmem[2] &&582582+ if (sk->sk_rcvbuf < rmem2 &&581583 !(sk->sk_userlocks & SOCK_RCVBUF_LOCK) &&582584 !tcp_under_memory_pressure(sk) &&583585 sk_memory_allocated(sk) < sk_prot_mem_limits(sk, 0)) {584586 WRITE_ONCE(sk->sk_rcvbuf,585585- min(atomic_read(&sk->sk_rmem_alloc),586586- net->ipv4.sysctl_tcp_rmem[2]));587587+ min(atomic_read(&sk->sk_rmem_alloc), rmem2));587588 }588589 if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)589590 tp->rcv_ssthresh = min(tp->window_clamp, 2U * tp->advmss);···725724 * <prev RTT . ><current RTT .. ><next RTT .... >726725 */727726728728- if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf &&727727+ if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf) &&729728 !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {730729 int rcvmem, rcvbuf;731730 u64 rcvwin, grow;···746745747746 do_div(rcvwin, tp->advmss);748747 rcvbuf = min_t(u64, rcvwin * rcvmem,749749- sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);748748+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));750749 if (rcvbuf > sk->sk_rcvbuf) {751750 WRITE_ONCE(sk->sk_rcvbuf, rcvbuf);752751···910909 * end of slow start and should slow down.911910 */912911 if (tcp_snd_cwnd(tp) < tp->snd_ssthresh / 2)913913- rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio;912912+ rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio);914913 else915915- rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio;914914+ rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio);916915917916 rate *= max(tcp_snd_cwnd(tp), tp->packets_out);918917···21752174 * loss recovery is underway except recurring timeout(s) on21762175 * the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing21772176 */21782178- tp->frto = net->ipv4.sysctl_tcp_frto &&21772177+ tp->frto = READ_ONCE(net->ipv4.sysctl_tcp_frto) &&21792178 (new_recovery || icsk->icsk_retransmits) &&21802179 !inet_csk(sk)->icsk_mtup.probe_size;21812180}···3058305730593058static void tcp_update_rtt_min(struct sock *sk, u32 rtt_us, const int flag)30603059{30613061- u32 wlen = sock_net(sk)->ipv4.sysctl_tcp_min_rtt_wlen * HZ;30603060+ u32 wlen = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_rtt_wlen) * HZ;30623061 struct tcp_sock *tp = tcp_sk(sk);3063306230643063 if ((flag & FLAG_ACK_MAYBE_DELAYED) && rtt_us > tcp_min_rtt(tp)) {···35813580 if (*last_oow_ack_time) {35823581 s32 elapsed = (s32)(tcp_jiffies32 - *last_oow_ack_time);3583358235843584- if (0 <= elapsed && elapsed < net->ipv4.sysctl_tcp_invalid_ratelimit) {35833583+ if (0 <= elapsed &&35843584+ elapsed < READ_ONCE(net->ipv4.sysctl_tcp_invalid_ratelimit)) {35853585 NET_INC_STATS(net, mib_idx);35863586 return true; /* rate-limited: don't send yet! */35873587 }···36303628 /* Then check host-wide RFC 5961 rate limit. */36313629 now = jiffies / HZ;36323630 if (now != challenge_timestamp) {36333633- u32 ack_limit = net->ipv4.sysctl_tcp_challenge_ack_limit;36313631+ u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);36343632 u32 half = (ack_limit + 1) >> 1;3635363336363634 challenge_timestamp = now;···44274425{44284426 struct tcp_sock *tp = tcp_sk(sk);4429442744304430- if (tcp_is_sack(tp) && sock_net(sk)->ipv4.sysctl_tcp_dsack) {44284428+ if (tcp_is_sack(tp) && READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_dsack)) {44314429 int mib_idx;4432443044334431 if (before(seq, tp->rcv_nxt))···44744472 NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);44754473 tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);4476447444774477- if (tcp_is_sack(tp) && sock_net(sk)->ipv4.sysctl_tcp_dsack) {44754475+ if (tcp_is_sack(tp) && READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_dsack)) {44784476 u32 end_seq = TCP_SKB_CB(skb)->end_seq;4479447744804478 tcp_rcv_spurious_retrans(sk, skb);···55185516 }5519551755205518 if (!tcp_is_sack(tp) ||55215521- tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr)55195519+ tp->compressed_ack >= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr))55225520 goto send_now;5523552155245522 if (tp->compressed_ack_rcv_nxt != tp->rcv_nxt) {···55395537 if (tp->srtt_us && tp->srtt_us < rtt)55405538 rtt = tp->srtt_us;5541553955425542- delay = min_t(unsigned long, sock_net(sk)->ipv4.sysctl_tcp_comp_sack_delay_ns,55405540+ delay = min_t(unsigned long,55415541+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_delay_ns),55435542 rtt * (NSEC_PER_USEC >> 3)/20);55445543 sock_hold(sk);55455544 hrtimer_start_range_ns(&tp->compressed_ack_timer, ns_to_ktime(delay),55465546- sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns,55455545+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns),55475546 HRTIMER_MODE_REL_PINNED_SOFT);55485547}55495548
+2-2
net/ipv4/tcp_ipv4.c
···10081008 if (skb) {10091009 __tcp_v4_send_check(skb, ireq->ir_loc_addr, ireq->ir_rmt_addr);1010101010111011- tos = sock_net(sk)->ipv4.sysctl_tcp_reflect_tos ?10111011+ tos = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos) ?10121012 (tcp_rsk(req)->syn_tos & ~INET_ECN_MASK) |10131013 (inet_sk(sk)->tos & INET_ECN_MASK) :10141014 inet_sk(sk)->tos;···15281528 /* Set ToS of the new socket based upon the value of incoming SYN.15291529 * ECT bits are set later in tcp_init_transfer().15301530 */15311531- if (sock_net(sk)->ipv4.sysctl_tcp_reflect_tos)15311531+ if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos))15321532 newinet->tos = tcp_rsk(req)->syn_tos & ~INET_ECN_MASK;1533153315341534 if (!dst) {
+5-5
net/ipv4/tcp_metrics.c
···329329 int m;330330331331 sk_dst_confirm(sk);332332- if (net->ipv4.sysctl_tcp_nometrics_save || !dst)332332+ if (READ_ONCE(net->ipv4.sysctl_tcp_nometrics_save) || !dst)333333 return;334334335335 rcu_read_lock();···385385386386 if (tcp_in_initial_slowstart(tp)) {387387 /* Slow start still did not finish. */388388- if (!net->ipv4.sysctl_tcp_no_ssthresh_metrics_save &&388388+ if (!READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) &&389389 !tcp_metric_locked(tm, TCP_METRIC_SSTHRESH)) {390390 val = tcp_metric_get(tm, TCP_METRIC_SSTHRESH);391391 if (val && (tcp_snd_cwnd(tp) >> 1) > val)···401401 } else if (!tcp_in_slow_start(tp) &&402402 icsk->icsk_ca_state == TCP_CA_Open) {403403 /* Cong. avoidance phase, cwnd is reliable. */404404- if (!net->ipv4.sysctl_tcp_no_ssthresh_metrics_save &&404404+ if (!READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) &&405405 !tcp_metric_locked(tm, TCP_METRIC_SSTHRESH))406406 tcp_metric_set(tm, TCP_METRIC_SSTHRESH,407407 max(tcp_snd_cwnd(tp) >> 1, tp->snd_ssthresh));···418418 tcp_metric_set(tm, TCP_METRIC_CWND,419419 (val + tp->snd_ssthresh) >> 1);420420 }421421- if (!net->ipv4.sysctl_tcp_no_ssthresh_metrics_save &&421421+ if (!READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) &&422422 !tcp_metric_locked(tm, TCP_METRIC_SSTHRESH)) {423423 val = tcp_metric_get(tm, TCP_METRIC_SSTHRESH);424424 if (val && tp->snd_ssthresh > val)···463463 if (tcp_metric_locked(tm, TCP_METRIC_CWND))464464 tp->snd_cwnd_clamp = tcp_metric_get(tm, TCP_METRIC_CWND);465465466466- val = net->ipv4.sysctl_tcp_no_ssthresh_metrics_save ?466466+ val = READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) ?467467 0 : tcp_metric_get(tm, TCP_METRIC_SSTHRESH);468468 if (val) {469469 tp->snd_ssthresh = val;
+12-15
net/ipv4/tcp_output.c
···167167 if (tcp_packets_in_flight(tp) == 0)168168 tcp_ca_event(sk, CA_EVENT_TX_START);169169170170- /* If this is the first data packet sent in response to the171171- * previous received data,172172- * and it is a reply for ato after last received packet,173173- * increase pingpong count.174174- */175175- if (before(tp->lsndtime, icsk->icsk_ack.lrcvtime) &&176176- (u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato)177177- inet_csk_inc_pingpong_cnt(sk);178178-179170 tp->lsndtime = now;171171+172172+ /* If it is a reply for ato after last received173173+ * packet, enter pingpong mode.174174+ */175175+ if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato)176176+ inet_csk_enter_pingpong_mode(sk);180177}181178182179/* Account for an ACK we sent. */···227230 * which we interpret as a sign the remote TCP is not228231 * misinterpreting the window field as a signed quantity.229232 */230230- if (sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows)233233+ if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows))231234 (*rcv_wnd) = min(space, MAX_TCP_WINDOW);232235 else233236 (*rcv_wnd) = min_t(u32, space, U16_MAX);···238241 *rcv_wscale = 0;239242 if (wscale_ok) {240243 /* Set window scaling on max possible window */241241- space = max_t(u32, space, sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);244244+ space = max_t(u32, space, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));242245 space = max_t(u32, space, sysctl_rmem_max);243246 space = min_t(u32, space, *window_clamp);244247 *rcv_wscale = clamp_t(int, ilog2(space) - 15,···282285 * scaled window.283286 */284287 if (!tp->rx_opt.rcv_wscale &&285285- sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows)288288+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows))286289 new_win = min(new_win, MAX_TCP_WINDOW);287290 else288291 new_win = min(new_win, (65535U << tp->rx_opt.rcv_wscale));···1973197619741977 bytes = sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift);1975197819761976- r = tcp_min_rtt(tcp_sk(sk)) >> sock_net(sk)->ipv4.sysctl_tcp_tso_rtt_log;19791979+ r = tcp_min_rtt(tcp_sk(sk)) >> READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_tso_rtt_log);19771980 if (r < BITS_PER_TYPE(sk->sk_gso_max_size))19781981 bytes += sk->sk_gso_max_size >> r;19791982···1992199519931996 min_tso = ca_ops->min_tso_segs ?19941997 ca_ops->min_tso_segs(sk) :19951995- sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs;19981998+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs);1996199919972000 tso_segs = tcp_tso_autosize(sk, mss_now, min_tso);19982001 return min_t(u32, tso_segs, sk->sk_gso_max_segs);···25042507 sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift));25052508 if (sk->sk_pacing_status == SK_PACING_NONE)25062509 limit = min_t(unsigned long, limit,25072507- sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);25102510+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes));25082511 limit <<= factor;2509251225102513 if (static_branch_unlikely(&tcp_tx_delay_enabled) &&
+8-6
net/ipv6/mcast.c
···1522152215231523 if (++cnt >= MLD_MAX_QUEUE) {15241524 rework = true;15251525- schedule_delayed_work(&idev->mc_query_work, 0);15261525 break;15271526 }15281527 }···15321533 __mld_query_work(skb);15331534 mutex_unlock(&idev->mc_lock);1534153515351535- if (!rework)15361536- in6_dev_put(idev);15361536+ if (rework && queue_delayed_work(mld_wq, &idev->mc_query_work, 0))15371537+ return;15381538+15391539+ in6_dev_put(idev);15371540}1538154115391542/* called with rcu_read_lock() */···1625162416261625 if (++cnt >= MLD_MAX_QUEUE) {16271626 rework = true;16281628- schedule_delayed_work(&idev->mc_report_work, 0);16291627 break;16301628 }16311629 }···16351635 __mld_report_work(skb);16361636 mutex_unlock(&idev->mc_lock);1637163716381638- if (!rework)16391639- in6_dev_put(idev);16381638+ if (rework && queue_delayed_work(mld_wq, &idev->mc_report_work, 0))16391639+ return;16401640+16411641+ in6_dev_put(idev);16401642}1641164316421644static bool is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type,
+6
net/ipv6/ping.c
···2222#include <linux/proc_fs.h>2323#include <net/ping.h>24242525+static void ping_v6_destroy(struct sock *sk)2626+{2727+ inet6_destroy_sock(sk);2828+}2929+2530/* Compatibility glue so we can support IPv6 when it's compiled as a module */2631static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,2732 int *addr_len)···190185 .owner = THIS_MODULE,191186 .init = ping_init_sock,192187 .close = ping_close,188188+ .destroy = ping_v6_destroy,193189 .connect = ip6_datagram_connect_v6_only,194190 .disconnect = __udp_disconnect,195191 .setsockopt = ipv6_setsockopt,
+2-2
net/ipv6/tcp_ipv6.c
···546546 if (np->repflow && ireq->pktopts)547547 fl6->flowlabel = ip6_flowlabel(ipv6_hdr(ireq->pktopts));548548549549- tclass = sock_net(sk)->ipv4.sysctl_tcp_reflect_tos ?549549+ tclass = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos) ?550550 (tcp_rsk(req)->syn_tos & ~INET_ECN_MASK) |551551 (np->tclass & INET_ECN_MASK) :552552 np->tclass;···13171317 /* Set ToS of the new socket based upon the value of incoming SYN.13181318 * ECT bits are set later in tcp_init_transfer().13191319 */13201320- if (sock_net(sk)->ipv4.sysctl_tcp_reflect_tos)13201320+ if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos))13211321 newnp->tclass = tcp_rsk(req)->syn_tos & ~INET_ECN_MASK;1322132213231323 /* Clone native IPv6 options from listening socket (if any)
···229229 if (!sctp_ulpq_init(&asoc->ulpq, asoc))230230 goto fail_init;231231232232- if (sctp_stream_init(&asoc->stream, asoc->c.sinit_num_ostreams,233233- 0, gfp))234234- goto fail_init;232232+ if (sctp_stream_init(&asoc->stream, asoc->c.sinit_num_ostreams, 0, gfp))233233+ goto stream_free;235234236235 /* Initialize default path MTU. */237236 asoc->pathmtu = sp->pathmtu;
+3-16
net/sctp/stream.c
···137137138138 ret = sctp_stream_alloc_out(stream, outcnt, gfp);139139 if (ret)140140- goto out_err;140140+ return ret;141141142142 for (i = 0; i < stream->outcnt; i++)143143 SCTP_SO(stream, i)->state = SCTP_STREAM_OPEN;···145145handle_in:146146 sctp_stream_interleave_init(stream);147147 if (!incnt)148148- goto out;148148+ return 0;149149150150- ret = sctp_stream_alloc_in(stream, incnt, gfp);151151- if (ret)152152- goto in_err;153153-154154- goto out;155155-156156-in_err:157157- sched->free(stream);158158- genradix_free(&stream->in);159159-out_err:160160- genradix_free(&stream->out);161161- stream->outcnt = 0;162162-out:163163- return ret;150150+ return sctp_stream_alloc_in(stream, incnt, gfp);164151}165152166153int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid)
+1-1
net/sctp/stream_sched.c
···160160 if (!SCTP_SO(&asoc->stream, i)->ext)161161 continue;162162163163- ret = n->init_sid(&asoc->stream, i, GFP_KERNEL);163163+ ret = n->init_sid(&asoc->stream, i, GFP_ATOMIC);164164 if (ret)165165 goto err;166166 }
···13831383 * by tls_device_free_ctx. rx_conf and tx_conf stay in TLS_HW.13841384 * Now release the ref taken above.13851385 */13861386- if (refcount_dec_and_test(&ctx->refcount))13861386+ if (refcount_dec_and_test(&ctx->refcount)) {13871387+ /* sk_destruct ran after tls_device_down took a ref, and13881388+ * it returned early. Complete the destruction here.13891389+ */13901390+ list_del(&ctx->list);13871391 tls_device_free_ctx(ctx);13921392+ }13881393 }1389139413901395 up_write(&device_offload_lock);
+31-129
sound/soc/rockchip/rockchip_i2s.c
···1313#include <linux/of_gpio.h>1414#include <linux/of_device.h>1515#include <linux/clk.h>1616-#include <linux/pinctrl/consumer.h>1716#include <linux/pm_runtime.h>1817#include <linux/regmap.h>1918#include <linux/spinlock.h>···5455 const struct rk_i2s_pins *pins;5556 unsigned int bclk_ratio;5657 spinlock_t lock; /* tx/rx lock */5757- struct pinctrl *pinctrl;5858- struct pinctrl_state *bclk_on;5959- struct pinctrl_state *bclk_off;6058};6161-6262-static int i2s_pinctrl_select_bclk_on(struct rk_i2s_dev *i2s)6363-{6464- int ret = 0;6565-6666- if (!IS_ERR(i2s->pinctrl) && !IS_ERR_OR_NULL(i2s->bclk_on))6767- ret = pinctrl_select_state(i2s->pinctrl,6868- i2s->bclk_on);6969-7070- if (ret)7171- dev_err(i2s->dev, "bclk enable failed %d\n", ret);7272-7373- return ret;7474-}7575-7676-static int i2s_pinctrl_select_bclk_off(struct rk_i2s_dev *i2s)7777-{7878-7979- int ret = 0;8080-8181- if (!IS_ERR(i2s->pinctrl) && !IS_ERR_OR_NULL(i2s->bclk_off))8282- ret = pinctrl_select_state(i2s->pinctrl,8383- i2s->bclk_off);8484-8585- if (ret)8686- dev_err(i2s->dev, "bclk disable failed %d\n", ret);8787-8888- return ret;8989-}90599160static int i2s_runtime_suspend(struct device *dev)9261{···92125 return snd_soc_dai_get_drvdata(dai);93126}941279595-static int rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)128128+static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)96129{97130 unsigned int val = 0;98131 int retry = 10;9999- int ret = 0;100132101133 spin_lock(&i2s->lock);102134 if (on) {103103- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,104104- I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_ENABLE);105105- if (ret < 0)106106- goto end;135135+ regmap_update_bits(i2s->regmap, I2S_DMACR,136136+ I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_ENABLE);107137108108- ret = regmap_update_bits(i2s->regmap, I2S_XFER,109109- I2S_XFER_TXS_START | I2S_XFER_RXS_START,110110- I2S_XFER_TXS_START | I2S_XFER_RXS_START);111111- if (ret < 0)112112- goto end;138138+ regmap_update_bits(i2s->regmap, I2S_XFER,139139+ I2S_XFER_TXS_START | I2S_XFER_RXS_START,140140+ I2S_XFER_TXS_START | I2S_XFER_RXS_START);113141114142 i2s->tx_start = true;115143 } else {116144 i2s->tx_start = false;117145118118- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,119119- I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_DISABLE);120120- if (ret < 0)121121- goto end;146146+ regmap_update_bits(i2s->regmap, I2S_DMACR,147147+ I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_DISABLE);122148123149 if (!i2s->rx_start) {124124- ret = regmap_update_bits(i2s->regmap, I2S_XFER,125125- I2S_XFER_TXS_START |126126- I2S_XFER_RXS_START,127127- I2S_XFER_TXS_STOP |128128- I2S_XFER_RXS_STOP);129129- if (ret < 0)130130- goto end;150150+ regmap_update_bits(i2s->regmap, I2S_XFER,151151+ I2S_XFER_TXS_START |152152+ I2S_XFER_RXS_START,153153+ I2S_XFER_TXS_STOP |154154+ I2S_XFER_RXS_STOP);131155132156 udelay(150);133133- ret = regmap_update_bits(i2s->regmap, I2S_CLR,134134- I2S_CLR_TXC | I2S_CLR_RXC,135135- I2S_CLR_TXC | I2S_CLR_RXC);136136- if (ret < 0)137137- goto end;157157+ regmap_update_bits(i2s->regmap, I2S_CLR,158158+ I2S_CLR_TXC | I2S_CLR_RXC,159159+ I2S_CLR_TXC | I2S_CLR_RXC);138160139161 regmap_read(i2s->regmap, I2S_CLR, &val);140162···138182 }139183 }140184 }141141-end:142185 spin_unlock(&i2s->lock);143143- if (ret < 0)144144- dev_err(i2s->dev, "lrclk update failed\n");145145-146146- return ret;147186}148187149149-static int rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)188188+static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)150189{151190 unsigned int val = 0;152191 int retry = 10;153153- int ret = 0;154192155193 spin_lock(&i2s->lock);156194 if (on) {157157- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,195195+ regmap_update_bits(i2s->regmap, I2S_DMACR,158196 I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_ENABLE);159159- if (ret < 0)160160- goto end;161197162162- ret = regmap_update_bits(i2s->regmap, I2S_XFER,198198+ regmap_update_bits(i2s->regmap, I2S_XFER,163199 I2S_XFER_TXS_START | I2S_XFER_RXS_START,164200 I2S_XFER_TXS_START | I2S_XFER_RXS_START);165165- if (ret < 0)166166- goto end;167201168202 i2s->rx_start = true;169203 } else {170204 i2s->rx_start = false;171205172172- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,206206+ regmap_update_bits(i2s->regmap, I2S_DMACR,173207 I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_DISABLE);174174- if (ret < 0)175175- goto end;176208177209 if (!i2s->tx_start) {178178- ret = regmap_update_bits(i2s->regmap, I2S_XFER,210210+ regmap_update_bits(i2s->regmap, I2S_XFER,179211 I2S_XFER_TXS_START |180212 I2S_XFER_RXS_START,181213 I2S_XFER_TXS_STOP |182214 I2S_XFER_RXS_STOP);183183- if (ret < 0)184184- goto end;215215+185216 udelay(150);186186- ret = regmap_update_bits(i2s->regmap, I2S_CLR,217217+ regmap_update_bits(i2s->regmap, I2S_CLR,187218 I2S_CLR_TXC | I2S_CLR_RXC,188219 I2S_CLR_TXC | I2S_CLR_RXC);189189- if (ret < 0)190190- goto end;220220+191221 regmap_read(i2s->regmap, I2S_CLR, &val);222222+192223 /* Should wait for clear operation to finish */193224 while (val) {194225 regmap_read(i2s->regmap, I2S_CLR, &val);···187244 }188245 }189246 }190190-end:191247 spin_unlock(&i2s->lock);192192- if (ret < 0)193193- dev_err(i2s->dev, "lrclk update failed\n");194194-195195- return ret;196248}197249198250static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,···425487 case SNDRV_PCM_TRIGGER_RESUME:426488 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:427489 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)428428- ret = rockchip_snd_rxctrl(i2s, 1);490490+ rockchip_snd_rxctrl(i2s, 1);429491 else430430- ret = rockchip_snd_txctrl(i2s, 1);431431- /* Do not turn on bclk if lrclk open fails. */432432- if (ret < 0)433433- return ret;434434- i2s_pinctrl_select_bclk_on(i2s);492492+ rockchip_snd_txctrl(i2s, 1);435493 break;436494 case SNDRV_PCM_TRIGGER_SUSPEND:437495 case SNDRV_PCM_TRIGGER_STOP:438496 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:439439- if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {440440- if (!i2s->tx_start)441441- i2s_pinctrl_select_bclk_off(i2s);442442- ret = rockchip_snd_rxctrl(i2s, 0);443443- } else {444444- if (!i2s->rx_start)445445- i2s_pinctrl_select_bclk_off(i2s);446446- ret = rockchip_snd_txctrl(i2s, 0);447447- }497497+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)498498+ rockchip_snd_rxctrl(i2s, 0);499499+ else500500+ rockchip_snd_txctrl(i2s, 0);448501 break;449502 default:450503 ret = -EINVAL;···736807 }737808738809 i2s->bclk_ratio = 64;739739- i2s->pinctrl = devm_pinctrl_get(&pdev->dev);740740- if (IS_ERR(i2s->pinctrl))741741- dev_err(&pdev->dev, "failed to find i2s pinctrl\n");742742-743743- i2s->bclk_on = pinctrl_lookup_state(i2s->pinctrl,744744- "bclk_on");745745- if (IS_ERR_OR_NULL(i2s->bclk_on))746746- dev_err(&pdev->dev, "failed to find i2s default state\n");747747- else748748- dev_dbg(&pdev->dev, "find i2s bclk state\n");749749-750750- i2s->bclk_off = pinctrl_lookup_state(i2s->pinctrl,751751- "bclk_off");752752- if (IS_ERR_OR_NULL(i2s->bclk_off))753753- dev_err(&pdev->dev, "failed to find i2s gpio state\n");754754- else755755- dev_dbg(&pdev->dev, "find i2s bclk_off state\n");756756-757757- i2s_pinctrl_select_bclk_off(i2s);758758-759759- i2s->playback_dma_data.addr = res->start + I2S_TXDR;760760- i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;761761- i2s->playback_dma_data.maxburst = 4;762762-763763- i2s->capture_dma_data.addr = res->start + I2S_RXDR;764764- i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;765765- i2s->capture_dma_data.maxburst = 4;766810767811 dev_set_drvdata(&pdev->dev, i2s);768812
+10-1
tools/include/uapi/asm-generic/fcntl.h
···11+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */12#ifndef _ASM_GENERIC_FCNTL_H23#define _ASM_GENERIC_FCNTL_H34···91909291/* a horrid kludge trying to make sure that this will fail on old kernels */9392#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)9494-#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)9393+#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT) 95949695#ifndef O_NDELAY9796#define O_NDELAY O_NONBLOCK···116115#define F_GETSIG 11 /* for sockets. */117116#endif118117118118+#if __BITS_PER_LONG == 32 || defined(__KERNEL__)119119#ifndef F_GETLK64120120#define F_GETLK64 12 /* using 'struct flock64' */121121#define F_SETLK64 13122122#define F_SETLKW64 14123123#endif124124+#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */124125125126#ifndef F_SETOWN_EX126127#define F_SETOWN_EX 15···181178 blocking */182179#define LOCK_UN 8 /* remove lock */183180181181+/*182182+ * LOCK_MAND support has been removed from the kernel. We leave the symbols183183+ * here to not break legacy builds, but these should not be used in new code.184184+ */184185#define LOCK_MAND 32 /* This is a mandatory flock ... */185186#define LOCK_READ 64 /* which allows concurrent read operations */186187#define LOCK_WRITE 128 /* which allows concurrent write operations */···192185193186#define F_LINUX_SPECIFIC_BASE 1024194187188188+#ifndef HAVE_ARCH_STRUCT_FLOCK195189struct flock {196190 short l_type;197191 short l_whence;···217209 __ARCH_FLOCK64_PAD218210#endif219211};212212+#endif /* HAVE_ARCH_STRUCT_FLOCK */220213221214#endif /* _ASM_GENERIC_FCNTL_H */