···244244an involved disclosed party. The current ambassadors list:245245246246 ============= ========================================================247247- ARM Grant Likely <grant.likely@arm.com>248247 AMD Tom Lendacky <tom.lendacky@amd.com>249249- IBM Z Christian Borntraeger <borntraeger@de.ibm.com>250250- IBM Power Anton Blanchard <anton@linux.ibm.com>248248+ Ampere Darren Hart <darren@os.amperecomputing.com>249249+ ARM Catalin Marinas <catalin.marinas@arm.com>250250+ IBM Power Anton Blanchard <anton@linux.ibm.com>251251+ IBM Z Christian Borntraeger <borntraeger@de.ibm.com>251252 Intel Tony Luck <tony.luck@intel.com>252253 Qualcomm Trilok Soni <tsoni@codeaurora.org>253254
+6-3
MAINTAINERS
···35713571L: netdev@vger.kernel.org35723572S: Supported35733573W: http://sourceforge.net/projects/bonding/35743574+F: Documentation/networking/bonding.rst35743575F: drivers/net/bonding/35753575-F: include/net/bonding.h35763576+F: include/net/bond*35763577F: include/uapi/linux/if_bonding.h3577357835783579BOSCH SENSORTEC BMA400 ACCELEROMETER IIO DRIVER···5440543954415440DATA ACCESS MONITOR54425441M: SeongJae Park <sj@kernel.org>54425442+L: damon@lists.linux.dev54435443L: linux-mm@kvack.org54445444S: Maintained54455445F: Documentation/ABI/testing/sysfs-kernel-mm-damon···1013310131F: drivers/net/wireless/intel/iwlegacy/10134101321013510133INTEL WIRELESS WIFI LINK (iwlwifi)1013610136-M: Luca Coelho <luciano.coelho@intel.com>1013410134+M: Gregory Greenman <gregory.greenman@intel.com>1013710135L: linux-wireless@vger.kernel.org1013810136S: Supported1013910137W: https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi···1547715475PERFORMANCE EVENTS TOOLING ARM641547815476R: John Garry <john.garry@huawei.com>1547915477R: Will Deacon <will@kernel.org>1548015480-R: Mathieu Poirier <mathieu.poirier@linaro.org>1547815478+R: James Clark <james.clark@arm.com>1547915479+R: Mike Leach <mike.leach@linaro.org>1548115480R: Leo Yan <leo.yan@linaro.org>1548215481L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1548315482S: Supported
···654654 ARM64_FTR_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0),655655 ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1,656656 &id_aa64isar1_override),657657- ARM64_FTR_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2),658657 ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2,659658 &id_aa64isar2_override),660659···809810 * to sys_id for subsequent binary search in get_arm64_ftr_reg()810811 * to work correctly.811812 */812812- BUG_ON(arm64_ftr_regs[i].sys_id < arm64_ftr_regs[i - 1].sys_id);813813+ BUG_ON(arm64_ftr_regs[i].sys_id <= arm64_ftr_regs[i - 1].sys_id);813814 }814815}815816
-3
arch/arm64/kernel/vdso/Makefile
···5252targets += vdso.lds5353CPPFLAGS_vdso.lds += -P -C -U$(ARCH)54545555-# Force dependency (incbin is bad)5656-$(obj)/vdso.o : $(obj)/vdso.so5757-5855# Link rule for the .so file, .lds has to be first5956$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE6057 $(call if_changed,vdsold_and_vdso_check)
-3
arch/arm64/kernel/vdso32/Makefile
···131131targets += vdso.lds132132CPPFLAGS_vdso.lds += -P -C -U$(ARCH)133133134134-# Force dependency (vdso.s includes vdso.so through incbin)135135-$(obj)/vdso.o: $(obj)/vdso.so136136-137134include/generated/vdso32-offsets.h: $(obj)/vdso.so.dbg FORCE138135 $(call if_changed,vdsosym)139136
+8
arch/arm64/mm/ioremap.c
···9999{100100 early_ioremap_setup();101101}102102+103103+bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,104104+ unsigned long flags)105105+{106106+ unsigned long pfn = PHYS_PFN(offset);107107+108108+ return pfn_is_map_memory(pfn);109109+}
+21-5
arch/powerpc/kvm/book3s_32_sr.S
···122122123123 /* 0x0 - 0xb */124124125125- /* 'current->mm' needs to be in r4 */126126- tophys(r4, r2)127127- lwz r4, MM(r4)128128- tophys(r4, r4)129129- /* This only clobbers r0, r3, r4 and r5 */125125+ /* switch_mmu_context() needs paging, let's enable it */126126+ mfmsr r9127127+ ori r11, r9, MSR_DR128128+ mtmsr r11129129+ sync130130+131131+ /* switch_mmu_context() clobbers r12, rescue it */132132+ SAVE_GPR(12, r1)133133+134134+ /* Calling switch_mmu_context(<inv>, current->mm, <inv>); */135135+ lwz r4, MM(r2)130136 bl switch_mmu_context137137+138138+ /* restore r12 */139139+ REST_GPR(12, r1)140140+141141+ /* Disable paging again */142142+ mfmsr r9143143+ li r6, MSR_DR144144+ andc r9, r9, r6145145+ mtmsr r9146146+ sync131147132148.endm
+3-2
arch/x86/mm/init_64.c
···902902903903static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)904904{905905+ const unsigned long page = ALIGN_DOWN(start, PMD_SIZE);906906+905907 vmemmap_flush_unused_pmd();906908907909 /*···916914 * Mark with PAGE_UNUSED the unused parts of the new memmap range917915 */918916 if (!IS_ALIGNED(start, PMD_SIZE))919919- memset((void *)start, PAGE_UNUSED,920920- start - ALIGN_DOWN(start, PMD_SIZE));917917+ memset((void *)page, PAGE_UNUSED, start - page);921918922919 /*923920 * We want to avoid memset(PAGE_UNUSED) when populating the vmemmap of
+17
drivers/base/firmware_loader/main.c
···735735 size_t offset, u32 opt_flags)736736{737737 struct firmware *fw = NULL;738738+ struct cred *kern_cred = NULL;739739+ const struct cred *old_cred;738740 bool nondirect = false;739741 int ret;740742···752750 offset, opt_flags);753751 if (ret <= 0) /* error or already assigned */754752 goto out;753753+754754+ /*755755+ * We are about to try to access the firmware file. Because we may have been756756+ * called by a driver when serving an unrelated request from userland, we use757757+ * the kernel credentials to read the file.758758+ */759759+ kern_cred = prepare_kernel_cred(NULL);760760+ if (!kern_cred) {761761+ ret = -ENOMEM;762762+ goto out;763763+ }764764+ old_cred = override_creds(kern_cred);755765756766 ret = fw_get_filesystem_firmware(device, fw->priv, "", NULL);757767···789775 opt_flags, ret);790776 } else791777 ret = assign_fw(fw, device);778778+779779+ revert_creds(old_cred);780780+ put_cred(kern_cred);792781793782 out:794783 if (ret < 0) {
+4-4
drivers/dma-buf/dma-buf.c
···543543 file->f_mode |= FMODE_LSEEK;544544 dmabuf->file = file;545545546546- ret = dma_buf_stats_setup(dmabuf);547547- if (ret)548548- goto err_sysfs;549549-550546 mutex_init(&dmabuf->lock);551547 INIT_LIST_HEAD(&dmabuf->attachments);552548553549 mutex_lock(&db_list.lock);554550 list_add(&dmabuf->list_node, &db_list.head);555551 mutex_unlock(&db_list.lock);552552+553553+ ret = dma_buf_stats_setup(dmabuf);554554+ if (ret)555555+ goto err_sysfs;556556557557 return dmabuf;558558
+5
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
···296296{297297 struct amdgpu_device *adev = ctx->adev;298298 enum amd_dpm_forced_level level;299299+ u32 current_stable_pstate;299300 int r;300301301302 mutex_lock(&adev->pm.stable_pstate_ctx_lock);···304303 r = -EBUSY;305304 goto done;306305 }306306+307307+ r = amdgpu_ctx_get_stable_pstate(ctx, ¤t_stable_pstate);308308+ if (r || (stable_pstate == current_stable_pstate))309309+ goto done;307310308311 switch (stable_pstate) {309312 case AMDGPU_CTX_STABLE_PSTATE_NONE:
···153153 dc->hwss.init_hw = dcn20_fpga_init_hw;154154 dc->hwseq->funcs.init_pipes = NULL;155155 }156156- if (dc->debug.disable_z10) {157157- /*hw not support z10 or sw disable it*/158158- dc->hwss.z10_restore = NULL;159159- dc->hwss.z10_save_init = NULL;160160- }161156}
+1-7
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
···13511351{13521352 struct amdgpu_device *adev = smu->adev;13531353 int ret = 0;13541354- /*13551355- * TODO: (adev->in_suspend && !adev->in_s0ix) is added to pair13561356- * the workaround which always reset the asic in suspend.13571357- * It's likely that workaround will be dropped in the future.13581358- * Then the change here should be dropped together.13591359- */13601354 bool use_baco = !smu->is_apu &&13611361- (((amdgpu_in_reset(adev) || (adev->in_suspend && !adev->in_s0ix)) &&13551355+ ((amdgpu_in_reset(adev) &&13621356 (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||13631357 ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev)));13641358
···123123124124 mutex_init(&tdev->iommu.mutex);125125126126- if (iommu_present(&platform_bus_type)) {126126+ if (device_iommu_mapped(dev)) {127127 tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);128128 if (!tdev->iommu.domain)129129 goto error;
···8282 return container_of(fence->base.lock, struct vmw_fence_manager, lock);8383}84848585+static u32 vmw_fence_goal_read(struct vmw_private *vmw)8686+{8787+ if ((vmw->capabilities2 & SVGA_CAP2_EXTRA_REGS) != 0)8888+ return vmw_read(vmw, SVGA_REG_FENCE_GOAL);8989+ else9090+ return vmw_fifo_mem_read(vmw, SVGA_FIFO_FENCE_GOAL);9191+}9292+9393+static void vmw_fence_goal_write(struct vmw_private *vmw, u32 value)9494+{9595+ if ((vmw->capabilities2 & SVGA_CAP2_EXTRA_REGS) != 0)9696+ vmw_write(vmw, SVGA_REG_FENCE_GOAL, value);9797+ else9898+ vmw_fifo_mem_write(vmw, SVGA_FIFO_FENCE_GOAL, value);9999+}100100+85101/*86102 * Note on fencing subsystem usage of irqs:87103 * Typically the vmw_fences_update function is called···408392 if (likely(!fman->seqno_valid))409393 return false;410394411411- goal_seqno = vmw_fifo_mem_read(fman->dev_priv, SVGA_FIFO_FENCE_GOAL);395395+ goal_seqno = vmw_fence_goal_read(fman->dev_priv);412396 if (likely(passed_seqno - goal_seqno >= VMW_FENCE_WRAP))413397 return false;414398···416400 list_for_each_entry(fence, &fman->fence_list, head) {417401 if (!list_empty(&fence->seq_passed_actions)) {418402 fman->seqno_valid = true;419419- vmw_fifo_mem_write(fman->dev_priv,420420- SVGA_FIFO_FENCE_GOAL,421421- fence->base.seqno);403403+ vmw_fence_goal_write(fman->dev_priv,404404+ fence->base.seqno);422405 break;423406 }424407 }···449434 if (dma_fence_is_signaled_locked(&fence->base))450435 return false;451436452452- goal_seqno = vmw_fifo_mem_read(fman->dev_priv, SVGA_FIFO_FENCE_GOAL);437437+ goal_seqno = vmw_fence_goal_read(fman->dev_priv);453438 if (likely(fman->seqno_valid &&454439 goal_seqno - fence->base.seqno < VMW_FENCE_WRAP))455440 return false;456441457457- vmw_fifo_mem_write(fman->dev_priv, SVGA_FIFO_FENCE_GOAL,458458- fence->base.seqno);442442+ vmw_fence_goal_write(fman->dev_priv, fence->base.seqno);459443 fman->seqno_valid = true;460444461445 return true;
+18-8
drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
···32323333#define VMW_FENCE_WRAP (1 << 24)34343535+static u32 vmw_irqflag_fence_goal(struct vmw_private *vmw)3636+{3737+ if ((vmw->capabilities2 & SVGA_CAP2_EXTRA_REGS) != 0)3838+ return SVGA_IRQFLAG_REG_FENCE_GOAL;3939+ else4040+ return SVGA_IRQFLAG_FENCE_GOAL;4141+}4242+3543/**3644 * vmw_thread_fn - Deferred (process context) irq handler3745 *···10496 wake_up_all(&dev_priv->fifo_queue);1059710698 if ((masked_status & (SVGA_IRQFLAG_ANY_FENCE |107107- SVGA_IRQFLAG_FENCE_GOAL)) &&9999+ vmw_irqflag_fence_goal(dev_priv))) &&108100 !test_and_set_bit(VMW_IRQTHREAD_FENCE, dev_priv->irqthread_pending))109101 ret = IRQ_WAKE_THREAD;110102···145137 if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP))146138 return true;147139148148- if (!(vmw_fifo_caps(dev_priv) & SVGA_FIFO_CAP_FENCE) &&149149- vmw_fifo_idle(dev_priv, seqno))140140+ if (!vmw_has_fences(dev_priv) && vmw_fifo_idle(dev_priv, seqno))150141 return true;151142152143 /**···167160 unsigned long timeout)168161{169162 struct vmw_fifo_state *fifo_state = dev_priv->fifo;163163+ bool fifo_down = false;170164171165 uint32_t count = 0;172166 uint32_t signal_seq;···184176 */185177186178 if (fifo_idle) {187187- down_read(&fifo_state->rwsem);188179 if (dev_priv->cman) {189180 ret = vmw_cmdbuf_idle(dev_priv->cman, interruptible,190181 10*HZ);191182 if (ret)192183 goto out_err;184184+ } else if (fifo_state) {185185+ down_read(&fifo_state->rwsem);186186+ fifo_down = true;193187 }194188 }195189···228218 }229219 }230220 finish_wait(&dev_priv->fence_queue, &__wait);231231- if (ret == 0 && fifo_idle)221221+ if (ret == 0 && fifo_idle && fifo_state)232222 vmw_fence_write(dev_priv, signal_seq);233223234224 wake_up_all(&dev_priv->fence_queue);235225out_err:236236- if (fifo_idle)226226+ if (fifo_down)237227 up_read(&fifo_state->rwsem);238228239229 return ret;···276266277267void vmw_goal_waiter_add(struct vmw_private *dev_priv)278268{279279- vmw_generic_waiter_add(dev_priv, SVGA_IRQFLAG_FENCE_GOAL,269269+ vmw_generic_waiter_add(dev_priv, vmw_irqflag_fence_goal(dev_priv),280270 &dev_priv->goal_queue_waiters);281271}282272283273void vmw_goal_waiter_remove(struct vmw_private *dev_priv)284274{285285- vmw_generic_waiter_remove(dev_priv, SVGA_IRQFLAG_FENCE_GOAL,275275+ vmw_generic_waiter_remove(dev_priv, vmw_irqflag_fence_goal(dev_priv),286276 &dev_priv->goal_queue_waiters);287277}288278
+5-3
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
···13441344 ret = vmw_kms_new_framebuffer_surface(dev_priv, surface, &vfb,13451345 mode_cmd,13461346 is_bo_proxy);13471347-13481347 /*13491348 * vmw_create_bo_proxy() adds a reference that is no longer13501349 * needed···13841385 ret = vmw_user_lookup_handle(dev_priv, file_priv,13851386 mode_cmd->handles[0],13861387 &surface, &bo);13871387- if (ret)13881388+ if (ret) {13891389+ DRM_ERROR("Invalid buffer object handle %u (0x%x).\n",13901390+ mode_cmd->handles[0], mode_cmd->handles[0]);13881391 goto err_out;13921392+ }138913931390139413911395 if (!bo &&13921396 !vmw_kms_srf_ok(dev_priv, mode_cmd->width, mode_cmd->height)) {13931393- DRM_ERROR("Surface size cannot exceed %dx%d",13971397+ DRM_ERROR("Surface size cannot exceed %dx%d\n",13941398 dev_priv->texture_max_width,13951399 dev_priv->texture_max_height);13961400 goto err_out;
+1-1
drivers/hwmon/Kconfig
···960960961961config SENSORS_LTQ_CPUTEMP962962 bool "Lantiq cpu temperature sensor driver"963963- depends on LANTIQ963963+ depends on SOC_XWAY964964 help965965 If you say yes here you get support for the temperature966966 sensor inside your CPU.
···809809 struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);810810 u32 reg, offset;811811812812+ if (priv->wol_ports_mask & BIT(port))813813+ return;814814+812815 if (port != core_readl(priv, CORE_IMP0_PRT_ID)) {813816 if (priv->type == BCM4908_DEVICE_ID ||814817 priv->type == BCM7445_DEVICE_ID)
+6-1
drivers/net/dsa/ocelot/felix.c
···403403{404404 struct ocelot *ocelot = ds->priv;405405 struct felix *felix = ocelot_to_felix(ocelot);406406+ struct ocelot_vcap_block *block_vcap_is2;406407 struct ocelot_vcap_filter *trap;407408 enum ocelot_mask_mode mask_mode;408409 unsigned long port_mask;···423422 /* We are sure that "cpu" was found, otherwise424423 * dsa_tree_setup_default_cpu() would have failed earlier.425424 */425425+ block_vcap_is2 = &ocelot->block[VCAP_IS2];426426427427 /* Make sure all traps are set up for that destination */428428- list_for_each_entry(trap, &ocelot->traps, trap_list) {428428+ list_for_each_entry(trap, &block_vcap_is2->rules, list) {429429+ if (!trap->is_trap)430430+ continue;431431+429432 /* Figure out the current trapping destination */430433 if (using_tag_8021q) {431434 /* Redirect to the tag_8021q CPU port. If timestamps
···2287228722882288/**22892289 * ice_ptp_tx_tstamp_cleanup - Cleanup old timestamp requests that got dropped22902290+ * @hw: pointer to the hw struct22902291 * @tx: PTP Tx tracker to clean up22912292 *22922293 * Loop through the Tx timestamp requests and see if any of them have been···22962295 * timestamp will never be captured. This might happen if the packet gets22972296 * discarded before it reaches the PHY timestamping block.22982297 */22992299-static void ice_ptp_tx_tstamp_cleanup(struct ice_ptp_tx *tx)22982298+static void ice_ptp_tx_tstamp_cleanup(struct ice_hw *hw, struct ice_ptp_tx *tx)23002299{23012300 u8 idx;23022301···2305230423062305 for_each_set_bit(idx, tx->in_use, tx->len) {23072306 struct sk_buff *skb;23072307+ u64 raw_tstamp;2308230823092309 /* Check if this SKB has been waiting for too long */23102310 if (time_is_after_jiffies(tx->tstamps[idx].start + 2 * HZ))23112311 continue;23122312+23132313+ /* Read tstamp to be able to use this register again */23142314+ ice_read_phy_tstamp(hw, tx->quad, idx + tx->quad_offset,23152315+ &raw_tstamp);2312231623132317 spin_lock(&tx->lock);23142318 skb = tx->tstamps[idx].skb;···2336233023372331 ice_ptp_update_cached_phctime(pf);2338233223392339- ice_ptp_tx_tstamp_cleanup(&pf->ptp.port.tx);23332333+ ice_ptp_tx_tstamp_cleanup(&pf->hw, &pf->ptp.port.tx);2340233423412335 /* Run twice a second */23422336 kthread_queue_delayed_work(ptp->kworker, &ptp->work,
+50-18
drivers/net/ethernet/intel/ice/ice_virtchnl.c
···13081308}1309130913101310/**13111311+ * ice_vf_vsi_dis_single_txq - disable a single Tx queue13121312+ * @vf: VF to disable queue for13131313+ * @vsi: VSI for the VF13141314+ * @q_id: VF relative (0-based) queue ID13151315+ *13161316+ * Attempt to disable the Tx queue passed in. If the Tx queue was successfully13171317+ * disabled then clear q_id bit in the enabled queues bitmap and return13181318+ * success. Otherwise return error.13191319+ */13201320+static int13211321+ice_vf_vsi_dis_single_txq(struct ice_vf *vf, struct ice_vsi *vsi, u16 q_id)13221322+{13231323+ struct ice_txq_meta txq_meta = { 0 };13241324+ struct ice_tx_ring *ring;13251325+ int err;13261326+13271327+ if (!test_bit(q_id, vf->txq_ena))13281328+ dev_dbg(ice_pf_to_dev(vsi->back), "Queue %u on VSI %u is not enabled, but stopping it anyway\n",13291329+ q_id, vsi->vsi_num);13301330+13311331+ ring = vsi->tx_rings[q_id];13321332+ if (!ring)13331333+ return -EINVAL;13341334+13351335+ ice_fill_txq_meta(vsi, ring, &txq_meta);13361336+13371337+ err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, vf->vf_id, ring, &txq_meta);13381338+ if (err) {13391339+ dev_err(ice_pf_to_dev(vsi->back), "Failed to stop Tx ring %d on VSI %d\n",13401340+ q_id, vsi->vsi_num);13411341+ return err;13421342+ }13431343+13441344+ /* Clear enabled queues flag */13451345+ clear_bit(q_id, vf->txq_ena);13461346+13471347+ return 0;13481348+}13491349+13501350+/**13111351 * ice_vc_dis_qs_msg13121352 * @vf: pointer to the VF info13131353 * @msg: pointer to the msg buffer13141354 *13151315- * called from the VF to disable all or specific13161316- * queue(s)13551355+ * called from the VF to disable all or specific queue(s)13171356 */13181357static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)13191358{···13891350 q_map = vqs->tx_queues;1390135113911352 for_each_set_bit(vf_q_id, &q_map, ICE_MAX_RSS_QS_PER_VF) {13921392- struct ice_tx_ring *ring = vsi->tx_rings[vf_q_id];13931393- struct ice_txq_meta txq_meta = { 0 };13941394-13951353 if (!ice_vc_isvalid_q_id(vf, vqs->vsi_id, vf_q_id)) {13961354 v_ret = VIRTCHNL_STATUS_ERR_PARAM;13971355 goto error_param;13981356 }1399135714001400- if (!test_bit(vf_q_id, vf->txq_ena))14011401- dev_dbg(ice_pf_to_dev(vsi->back), "Queue %u on VSI %u is not enabled, but stopping it anyway\n",14021402- vf_q_id, vsi->vsi_num);14031403-14041404- ice_fill_txq_meta(vsi, ring, &txq_meta);14051405-14061406- if (ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, vf->vf_id,14071407- ring, &txq_meta)) {14081408- dev_err(ice_pf_to_dev(vsi->back), "Failed to stop Tx ring %d on VSI %d\n",14091409- vf_q_id, vsi->vsi_num);13581358+ if (ice_vf_vsi_dis_single_txq(vf, vsi, vf_q_id)) {14101359 v_ret = VIRTCHNL_STATUS_ERR_PARAM;14111360 goto error_param;14121361 }14131413-14141414- /* Clear enabled queues flag */14151415- clear_bit(vf_q_id, vf->txq_ena);14161362 }14171363 }14181364···16461622 if (qpi->txq.ring_len > 0) {16471623 vsi->tx_rings[i]->dma = qpi->txq.dma_ring_addr;16481624 vsi->tx_rings[i]->count = qpi->txq.ring_len;16251625+16261626+ /* Disable any existing queue first */16271627+ if (ice_vf_vsi_dis_single_txq(vf, vsi, q_idx)) {16281628+ v_ret = VIRTCHNL_STATUS_ERR_PARAM;16291629+ goto error_param;16301630+ }16311631+16321632+ /* Configure a queue with the requested settings */16491633 if (ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx)) {16501634 v_ret = VIRTCHNL_STATUS_ERR_PARAM;16511635 goto error_param;
···16221622 trap->action.mask_mode = OCELOT_MASK_MODE_PERMIT_DENY;16231623 trap->action.port_mask = 0;16241624 trap->take_ts = take_ts;16251625- list_add_tail(&trap->trap_list, &ocelot->traps);16251625+ trap->is_trap = true;16261626 new = true;16271627 }16281628···16341634 err = ocelot_vcap_filter_replace(ocelot, trap);16351635 if (err) {16361636 trap->ingress_port_mask &= ~BIT(port);16371637- if (!trap->ingress_port_mask) {16381638- list_del(&trap->trap_list);16371637+ if (!trap->ingress_port_mask)16391638 kfree(trap);16401640- }16411639 return err;16421640 }16431641···16551657 return 0;1656165816571659 trap->ingress_port_mask &= ~BIT(port);16581658- if (!trap->ingress_port_mask) {16591659- list_del(&trap->trap_list);16601660-16601660+ if (!trap->ingress_port_mask)16611661 return ocelot_vcap_filter_del(ocelot, trap);16621662- }1663166216641663 return ocelot_vcap_filter_replace(ocelot, trap);16651664}
+4-5
drivers/net/ethernet/mscc/ocelot_flower.c
···280280 filter->type = OCELOT_VCAP_FILTER_OFFLOAD;281281 break;282282 case FLOW_ACTION_TRAP:283283- if (filter->block_id != VCAP_IS2) {283283+ if (filter->block_id != VCAP_IS2 ||284284+ filter->lookup != 0) {284285 NL_SET_ERR_MSG_MOD(extack,285285- "Trap action can only be offloaded to VCAP IS2");286286+ "Trap action can only be offloaded to VCAP IS2 lookup 0");286287 return -EOPNOTSUPP;287288 }288289 if (filter->goto_target != -1) {···296295 filter->action.cpu_copy_ena = true;297296 filter->action.cpu_qu_num = 0;298297 filter->type = OCELOT_VCAP_FILTER_OFFLOAD;299299- list_add_tail(&filter->trap_list, &ocelot->traps);298298+ filter->is_trap = true;300299 break;301300 case FLOW_ACTION_POLICE:302301 if (filter->block_id == PSFP_BLOCK_ID) {···879878880879 ret = ocelot_flower_parse(ocelot, port, ingress, f, filter);881880 if (ret) {882882- if (!list_empty(&filter->trap_list))883883- list_del(&filter->trap_list);884881 kfree(filter);885882 return ret;886883 }
+8-1
drivers/net/ethernet/mscc/ocelot_vcap.c
···374374 OCELOT_VCAP_BIT_0);375375 vcap_key_set(vcap, &data, VCAP_IS2_HK_IGR_PORT_MASK, 0,376376 ~filter->ingress_port_mask);377377- vcap_key_bit_set(vcap, &data, VCAP_IS2_HK_FIRST, OCELOT_VCAP_BIT_ANY);378377 vcap_key_bit_set(vcap, &data, VCAP_IS2_HK_HOST_MATCH,379378 OCELOT_VCAP_BIT_ANY);380379 vcap_key_bit_set(vcap, &data, VCAP_IS2_HK_L2_MC, filter->dmac_mc);···12161217 struct ocelot_vcap_filter *tmp;1217121812181219 tmp = ocelot_vcap_block_find_filter_by_index(block, i);12201220+ /* Read back the filter's counters before moving it */12211221+ vcap_entry_get(ocelot, i - 1, tmp);12191222 vcap_entry_set(ocelot, i, tmp);12201223 }12211224···12511250 struct ocelot_vcap_filter del_filter;12521251 int i, index;1253125212531253+ /* Need to inherit the block_id so that vcap_entry_set()12541254+ * does not get confused and knows where to install it.12551255+ */12541256 memset(&del_filter, 0, sizeof(del_filter));12571257+ del_filter.block_id = filter->block_id;1255125812561259 /* Gets index of the filter */12571260 index = ocelot_vcap_block_get_filter_index(block, filter);···12701265 struct ocelot_vcap_filter *tmp;1271126612721267 tmp = ocelot_vcap_block_find_filter_by_index(block, i);12681268+ /* Read back the filter's counters before moving it */12691269+ vcap_entry_get(ocelot, i + 1, tmp);12731270 vcap_entry_set(ocelot, i, tmp);12741271 }12751272
···17361736 lcs_schedule_recovery(card);17371737 break;17381738 case LCS_CMD_STOPLAN:17391739- pr_warn("Stoplan for %s initiated by LGW\n",17401740- card->dev->name);17411741- if (card->dev)17391739+ if (card->dev) {17401740+ pr_warn("Stoplan for %s initiated by LGW\n",17411741+ card->dev->name);17421742 netif_carrier_off(card->dev);17431743+ }17431744 break;17441745 default:17451746 LCS_DBF_TEXT(5, trace, "noLGWcmd");
+1-2
drivers/scsi/device_handler/scsi_dh_alua.c
···11721172 case SCSI_ACCESS_STATE_OPTIMAL:11731173 case SCSI_ACCESS_STATE_ACTIVE:11741174 case SCSI_ACCESS_STATE_LBA:11751175- return BLK_STS_OK;11761175 case SCSI_ACCESS_STATE_TRANSITIONING:11771177- return BLK_STS_AGAIN;11761176+ return BLK_STS_OK;11781177 default:11791178 req->rq_flags |= RQF_QUIET;11801179 return BLK_STS_IOERR;
+1-1
drivers/scsi/lpfc/lpfc_els.c
···13301330 if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) ==13311331 LPFC_SLI_INTF_IF_TYPE_0) {13321332 /* FLOGI needs to be 3 for WQE FCFI */13331333- ct = ((SLI4_CT_FCFI >> 1) & 1) | (SLI4_CT_FCFI & 1);13331333+ ct = SLI4_CT_FCFI;13341334 bf_set(wqe_ct, &wqe->els_req.wqe_com, ct);1335133513361336 /* Set the fcfi to the fcfi we registered with */
···3826382638273827 spin_lock_irqsave(&cmd->cmd_lock, flags);38283828 if (cmd->aborted) {38293829+ if (cmd->sg_mapped)38303830+ qlt_unmap_sg(vha, cmd);38313831+38293832 spin_unlock_irqrestore(&cmd->cmd_lock, flags);38303833 /*38313834 * It's normal to see 2 calls in this path:
+2-2
drivers/slimbus/qcom-ctrl.c
···510510 }511511512512 ctrl->irq = platform_get_irq(pdev, 0);513513- if (!ctrl->irq) {513513+ if (ctrl->irq < 0) {514514 dev_err(&pdev->dev, "no slimbus IRQ\n");515515- return -ENODEV;515515+ return ctrl->irq;516516 }517517518518 sctrl = &ctrl->ctrl;
+12-8
drivers/tty/n_gsm.c
···137137 int retries;138138 /* Uplink tty if active */139139 struct tty_port port; /* The tty bound to this DLCI if there is one */140140+#define TX_SIZE 4096 /* Must be power of 2. */140141 struct kfifo fifo; /* Queue fifo for the DLCI */141142 int adaption; /* Adaption layer in use */142143 int prev_adaption;···16591658 if (len == 0)16601659 return;16611660 }16611661+ len--;16621662 slen++;16631663 tty = tty_port_tty_get(port);16641664 if (tty) {···17321730 return NULL;17331731 spin_lock_init(&dlci->lock);17341732 mutex_init(&dlci->mutex);17351735- if (kfifo_alloc(&dlci->fifo, 4096, GFP_KERNEL) < 0) {17331733+ if (kfifo_alloc(&dlci->fifo, TX_SIZE, GFP_KERNEL) < 0) {17361734 kfree(dlci);17371735 return NULL;17381736 }···2353235123542352static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)23552353{23542354+ int ret = 0;23562355 int need_close = 0;23572356 int need_restart = 0;23582357···24212418 * FIXME: We need to separate activation/deactivation from adding24222419 * and removing from the mux array24232420 */24242424- if (need_restart)24252425- gsm_activate_mux(gsm);24262426- if (gsm->initiator && need_close)24272427- gsm_dlci_begin_open(gsm->dlci[0]);24212421+ if (gsm->dead) {24222422+ ret = gsm_activate_mux(gsm);24232423+ if (ret)24242424+ return ret;24252425+ if (gsm->initiator)24262426+ gsm_dlci_begin_open(gsm->dlci[0]);24272427+ }24282428 return 0;24292429}24302430···29772971 * Virtual tty side29782972 */2979297329802980-#define TX_SIZE 51229812981-29822974/**29832975 * gsm_modem_upd_via_data - send modem bits via convergence layer29842976 * @dlci: channel···32163212 struct gsm_dlci *dlci = tty->driver_data;32173213 if (dlci->state == DLCI_CLOSED)32183214 return 0;32193219- return TX_SIZE - kfifo_len(&dlci->fifo);32153215+ return kfifo_avail(&dlci->fifo);32203216}3221321732223218static unsigned int gsmtty_chars_in_buffer(struct tty_struct *tty)
···890890{891891 struct usb_composite_dev *cdev = c->cdev;892892 struct uvc_device *uvc = to_uvc(f);893893+ long wait_ret = 1;893894894895 uvcg_info(f, "%s()\n", __func__);896896+897897+ /* If we know we're connected via v4l2, then there should be a cleanup898898+ * of the device from userspace either via UVC_EVENT_DISCONNECT or899899+ * though the video device removal uevent. Allow some time for the900900+ * application to close out before things get deleted.901901+ */902902+ if (uvc->func_connected) {903903+ uvcg_dbg(f, "waiting for clean disconnect\n");904904+ wait_ret = wait_event_interruptible_timeout(uvc->func_connected_queue,905905+ uvc->func_connected == false, msecs_to_jiffies(500));906906+ uvcg_dbg(f, "done waiting with ret: %ld\n", wait_ret);907907+ }895908896909 device_remove_file(&uvc->vdev.dev, &dev_attr_function_name);897910 video_unregister_device(&uvc->vdev);898911 v4l2_device_unregister(&uvc->v4l2_dev);912912+913913+ if (uvc->func_connected) {914914+ /* Wait for the release to occur to ensure there are no longer any915915+ * pending operations that may cause panics when resources are cleaned916916+ * up.917917+ */918918+ uvcg_warn(f, "%s no clean disconnect, wait for release\n", __func__);919919+ wait_ret = wait_event_interruptible_timeout(uvc->func_connected_queue,920920+ uvc->func_connected == false, msecs_to_jiffies(1000));921921+ uvcg_dbg(f, "done waiting for release with ret: %ld\n", wait_ret);922922+ }899923900924 usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);901925 kfree(uvc->control_buf);···939915940916 mutex_init(&uvc->video.mutex);941917 uvc->state = UVC_STATE_DISCONNECTED;918918+ init_waitqueue_head(&uvc->func_connected_queue);942919 opts = fi_to_f_uvc_opts(fi);943920944921 mutex_lock(&opts->lock);
···1919#define HS_BW_BOUNDARY 61442020/* usb2 spec section11.18.1: at most 188 FS bytes per microframe */2121#define FS_PAYLOAD_MAX 1882222-/*2323- * max number of microframes for split transfer,2424- * for fs isoc in : 1 ss + 1 idle + 7 cs2525- */2626-#define TT_MICROFRAMES_MAX 927222823#define DBG_BUF_EN 642924···237242238243static struct mu3h_sch_ep_info *239244create_sch_ep(struct xhci_hcd_mtk *mtk, struct usb_device *udev,240240- struct usb_host_endpoint *ep, struct xhci_ep_ctx *ep_ctx)245245+ struct usb_host_endpoint *ep)241246{242247 struct mu3h_sch_ep_info *sch_ep;243248 struct mu3h_sch_bw_info *bw_info;244249 struct mu3h_sch_tt *tt = NULL;245245- u32 len_bw_budget_table;246250247251 bw_info = get_bw_info(mtk, udev, ep);248252 if (!bw_info)249253 return ERR_PTR(-ENODEV);250254251251- if (is_fs_or_ls(udev->speed))252252- len_bw_budget_table = TT_MICROFRAMES_MAX;253253- else if ((udev->speed >= USB_SPEED_SUPER)254254- && usb_endpoint_xfer_isoc(&ep->desc))255255- len_bw_budget_table = get_esit(ep_ctx);256256- else257257- len_bw_budget_table = 1;258258-259259- sch_ep = kzalloc(struct_size(sch_ep, bw_budget_table,260260- len_bw_budget_table),261261- GFP_KERNEL);255255+ sch_ep = kzalloc(sizeof(*sch_ep), GFP_KERNEL);262256 if (!sch_ep)263257 return ERR_PTR(-ENOMEM);264258···279295 u32 mult;280296 u32 esit_pkts;281297 u32 max_esit_payload;282282- u32 *bwb_table = sch_ep->bw_budget_table;283283- int i;284298285299 ep_type = CTX_TO_EP_TYPE(le32_to_cpu(ep_ctx->ep_info2));286300 maxpkt = MAX_PACKET_DECODED(le32_to_cpu(ep_ctx->ep_info2));···314332 */315333 sch_ep->pkts = max_burst + 1;316334 sch_ep->bw_cost_per_microframe = maxpkt * sch_ep->pkts;317317- bwb_table[0] = sch_ep->bw_cost_per_microframe;318335 } else if (sch_ep->speed >= USB_SPEED_SUPER) {319336 /* usb3_r1 spec section4.4.7 & 4.4.8 */320337 sch_ep->cs_count = 0;···330349 if (ep_type == INT_IN_EP || ep_type == INT_OUT_EP) {331350 sch_ep->pkts = esit_pkts;332351 sch_ep->num_budget_microframes = 1;333333- bwb_table[0] = maxpkt * sch_ep->pkts;334352 }335353336354 if (ep_type == ISOC_IN_EP || ep_type == ISOC_OUT_EP) {···346366 DIV_ROUND_UP(esit_pkts, sch_ep->pkts);347367348368 sch_ep->repeat = !!(sch_ep->num_budget_microframes > 1);349349- sch_ep->bw_cost_per_microframe = maxpkt * sch_ep->pkts;350350-351351- for (i = 0; i < sch_ep->num_budget_microframes - 1; i++)352352- bwb_table[i] = sch_ep->bw_cost_per_microframe;353353-354354- /* last one <= bw_cost_per_microframe */355355- bwb_table[i] = maxpkt * esit_pkts356356- - i * sch_ep->bw_cost_per_microframe;357369 }370370+ sch_ep->bw_cost_per_microframe = maxpkt * sch_ep->pkts;358371 } else if (is_fs_or_ls(sch_ep->speed)) {359372 sch_ep->pkts = 1; /* at most one packet for each microframe */360373···357384 */358385 sch_ep->cs_count = DIV_ROUND_UP(maxpkt, FS_PAYLOAD_MAX);359386 sch_ep->num_budget_microframes = sch_ep->cs_count;360360- sch_ep->bw_cost_per_microframe =361361- (maxpkt < FS_PAYLOAD_MAX) ? maxpkt : FS_PAYLOAD_MAX;362362-363363- /* init budget table */364364- if (ep_type == ISOC_OUT_EP) {365365- for (i = 0; i < sch_ep->num_budget_microframes; i++)366366- bwb_table[i] = sch_ep->bw_cost_per_microframe;367367- } else if (ep_type == INT_OUT_EP) {368368- /* only first one consumes bandwidth, others as zero */369369- bwb_table[0] = sch_ep->bw_cost_per_microframe;370370- } else { /* INT_IN_EP or ISOC_IN_EP */371371- bwb_table[0] = 0; /* start split */372372- bwb_table[1] = 0; /* idle */373373- /*374374- * due to cs_count will be updated according to cs375375- * position, assign all remainder budget array376376- * elements as @bw_cost_per_microframe, but only first377377- * @num_budget_microframes elements will be used later378378- */379379- for (i = 2; i < TT_MICROFRAMES_MAX; i++)380380- bwb_table[i] = sch_ep->bw_cost_per_microframe;381381- }387387+ sch_ep->bw_cost_per_microframe = min_t(u32, maxpkt, FS_PAYLOAD_MAX);382388 }383389}384390···374422375423 for (j = 0; j < sch_ep->num_budget_microframes; j++) {376424 k = XHCI_MTK_BW_INDEX(base + j);377377- bw = sch_bw->bus_bw[k] + sch_ep->bw_budget_table[j];425425+ bw = sch_bw->bus_bw[k] + sch_ep->bw_cost_per_microframe;378426 if (bw > max_bw)379427 max_bw = bw;380428 }···385433static void update_bus_bw(struct mu3h_sch_bw_info *sch_bw,386434 struct mu3h_sch_ep_info *sch_ep, bool used)387435{436436+ int bw_updated;388437 u32 base;389389- int i, j, k;438438+ int i, j;439439+440440+ bw_updated = sch_ep->bw_cost_per_microframe * (used ? 1 : -1);390441391442 for (i = 0; i < sch_ep->num_esit; i++) {392443 base = sch_ep->offset + i * sch_ep->esit;393393- for (j = 0; j < sch_ep->num_budget_microframes; j++) {394394- k = XHCI_MTK_BW_INDEX(base + j);395395- if (used)396396- sch_bw->bus_bw[k] += sch_ep->bw_budget_table[j];397397- else398398- sch_bw->bus_bw[k] -= sch_ep->bw_budget_table[j];399399- }444444+ for (j = 0; j < sch_ep->num_budget_microframes; j++)445445+ sch_bw->bus_bw[XHCI_MTK_BW_INDEX(base + j)] += bw_updated;400446 }401447}402448···414464 */415465 for (j = 0; j < sch_ep->num_budget_microframes; j++) {416466 k = XHCI_MTK_BW_INDEX(base + j);417417- tmp = tt->fs_bus_bw[k] + sch_ep->bw_budget_table[j];467467+ tmp = tt->fs_bus_bw[k] + sch_ep->bw_cost_per_microframe;418468 if (tmp > FS_PAYLOAD_MAX)419469 return -ESCH_BW_OVERFLOW;420470 }···488538static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used)489539{490540 struct mu3h_sch_tt *tt = sch_ep->sch_tt;541541+ int bw_updated;491542 u32 base;492492- int i, j, k;543543+ int i, j;544544+545545+ bw_updated = sch_ep->bw_cost_per_microframe * (used ? 1 : -1);493546494547 for (i = 0; i < sch_ep->num_esit; i++) {495548 base = sch_ep->offset + i * sch_ep->esit;496549497497- for (j = 0; j < sch_ep->num_budget_microframes; j++) {498498- k = XHCI_MTK_BW_INDEX(base + j);499499- if (used)500500- tt->fs_bus_bw[k] += sch_ep->bw_budget_table[j];501501- else502502- tt->fs_bus_bw[k] -= sch_ep->bw_budget_table[j];503503- }550550+ for (j = 0; j < sch_ep->num_budget_microframes; j++)551551+ tt->fs_bus_bw[XHCI_MTK_BW_INDEX(base + j)] += bw_updated;504552 }505553506554 if (used)···658710659711 xhci_dbg(xhci, "%s %s\n", __func__, decode_ep(ep, udev->speed));660712661661- sch_ep = create_sch_ep(mtk, udev, ep, ep_ctx);713713+ sch_ep = create_sch_ep(mtk, udev, ep);662714 if (IS_ERR_OR_NULL(sch_ep))663715 return -ENOMEM;664716
-2
drivers/usb/host/xhci-mtk.h
···8383 * times; 1: distribute the (bMaxBurst+1)*(Mult+1) packets8484 * according to @pkts and @repeat. normal mode is used by8585 * default8686- * @bw_budget_table: table to record bandwidth budget per microframe8786 */8887struct mu3h_sch_ep_info {8988 u32 esit;···108109 u32 pkts;109110 u32 cs_count;110111 u32 burst_mode;111111- u32 bw_budget_table[];112112};113113114114#define MU3C_U3_PORT_MAX 4
···166166 {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */167167 {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */168168 {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */169169+ {DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */170170+ {DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */169171 {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */170172 {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */171173 {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
+1-1
drivers/usb/typec/tcpm/tcpci.c
···877877 /* Disable chip interrupts before unregistering port */878878 err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, 0);879879 if (err < 0)880880- return err;880880+ dev_warn(&client->dev, "Failed to disable irqs (%pe)\n", ERR_PTR(err));881881882882 tcpci_unregister_port(chip->tcpci);883883
+26
drivers/usb/typec/tcpm/tcpci_mt6360.c
···15151616#include "tcpci.h"17171818+#define MT6360_REG_PHYCTRL1 0x801919+#define MT6360_REG_PHYCTRL3 0x822020+#define MT6360_REG_PHYCTRL7 0x861821#define MT6360_REG_VCONNCTRL1 0x8C1922#define MT6360_REG_MODECTRL2 0x8F2023#define MT6360_REG_SWRESET 0xA0···2522#define MT6360_REG_DRPCTRL1 0xA22623#define MT6360_REG_DRPCTRL2 0xA32724#define MT6360_REG_I2CTORST 0xBF2525+#define MT6360_REG_PHYCTRL11 0xCA2626+#define MT6360_REG_RXCTRL1 0xCE2827#define MT6360_REG_RXCTRL2 0xCF2928#define MT6360_REG_CTDCTRL2 0xEC3029···108103 /* Enable Rpdet oneshot detection */109104 ret = regmap_update_bits(regmap, MT6360_REG_CTDCTRL2, MT6360_RPONESHOT_ENABLE,110105 MT6360_RPONESHOT_ENABLE);106106+ if (ret)107107+ return ret;108108+109109+ /* BMC PHY */110110+ ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL1, 0x3A70);111111+ if (ret)112112+ return ret;113113+114114+ ret = regmap_write(regmap, MT6360_REG_PHYCTRL3, 0x82);115115+ if (ret)116116+ return ret;117117+118118+ ret = regmap_write(regmap, MT6360_REG_PHYCTRL7, 0x36);119119+ if (ret)120120+ return ret;121121+122122+ ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL11, 0x3C60);123123+ if (ret)124124+ return ret;125125+126126+ ret = regmap_write(regmap, MT6360_REG_RXCTRL1, 0xE8);111127 if (ret)112128 return ret;113129
+1-4
drivers/video/fbdev/core/fbmem.c
···14341434__acquires(&info->lock)14351435__releases(&info->lock)14361436{14371437- struct fb_info * const info = file_fb_info(file);14381438-14391439- if (!info)14401440- return -ENODEV;14371437+ struct fb_info * const info = file->private_data;1441143814421439 lock_fb_info(info);14431440 if (info->fbops->fb_release)
+4
drivers/video/fbdev/core/fbsysfs.c
···8080{8181 if (!info)8282 return;8383+8484+ if (WARN_ON(refcount_read(&info->count)))8585+ return;8686+8387 kfree(info->apertures);8488 kfree(info);8589}
+8-1
drivers/video/fbdev/efifb.c
···243243static inline void efifb_show_boot_graphics(struct fb_info *info) {}244244#endif245245246246+/*247247+ * fb_ops.fb_destroy is called by the last put_fb_info() call at the end248248+ * of unregister_framebuffer() or fb_release(). Do any cleanup here.249249+ */246250static void efifb_destroy(struct fb_info *info)247251{248252 if (efifb_pci_dev)···258254 else259255 memunmap(info->screen_base);260256 }257257+261258 if (request_mem_succeeded)262259 release_mem_region(info->apertures->ranges[0].base,263260 info->apertures->ranges[0].size);264261 fb_dealloc_cmap(&info->cmap);262262+263263+ framebuffer_release(info);265264}266265267266static const struct fb_ops efifb_ops = {···627620{628621 struct fb_info *info = platform_get_drvdata(pdev);629622623623+ /* efifb_destroy takes care of info cleanup */630624 unregister_framebuffer(info);631625 sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);632632- framebuffer_release(info);633626634627 return 0;635628}
+7-1
drivers/video/fbdev/simplefb.c
···8484static void simplefb_clocks_destroy(struct simplefb_par *par);8585static void simplefb_regulators_destroy(struct simplefb_par *par);86868787+/*8888+ * fb_ops.fb_destroy is called by the last put_fb_info() call at the end8989+ * of unregister_framebuffer() or fb_release(). Do any cleanup here.9090+ */8791static void simplefb_destroy(struct fb_info *info)8892{8993 struct simplefb_par *par = info->par;···9793 simplefb_clocks_destroy(info->par);9894 if (info->screen_base)9995 iounmap(info->screen_base);9696+9797+ framebuffer_release(info);1009810199 if (mem)102100 release_mem_region(mem->start, resource_size(mem));···551545{552546 struct fb_info *info = platform_get_drvdata(pdev);553547548548+ /* simplefb_destroy takes care of info cleanup */554549 unregister_framebuffer(info);555555- framebuffer_release(info);556550557551 return 0;558552}
+7-1
drivers/video/fbdev/vesafb.c
···179179 return err;180180}181181182182+/*183183+ * fb_ops.fb_destroy is called by the last put_fb_info() call at the end184184+ * of unregister_framebuffer() or fb_release(). Do any cleanup here.185185+ */182186static void vesafb_destroy(struct fb_info *info)183187{184188 struct vesafb_par *par = info->par;···192188 if (info->screen_base)193189 iounmap(info->screen_base);194190 release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);191191+192192+ framebuffer_release(info);195193}196194197195static struct fb_ops vesafb_ops = {···490484{491485 struct fb_info *info = platform_get_drvdata(pdev);492486487487+ /* vesafb_destroy takes care of info cleanup */493488 unregister_framebuffer(info);494489 if (((struct vesafb_par *)(info->par))->region)495490 release_region(0x3c0, 32);496496- framebuffer_release(info);497491498492 return 0;499493}
+7-4
fs/ceph/addr.c
···8585 if (folio_test_dirty(folio)) {8686 dout("%p dirty_folio %p idx %lu -- already dirty\n",8787 mapping->host, folio, folio->index);8888- BUG_ON(!folio_get_private(folio));8888+ VM_BUG_ON_FOLIO(!folio_test_private(folio), folio);8989 return false;9090 }9191···122122 * Reference snap context in folio->private. Also set123123 * PagePrivate so that we get invalidate_folio callback.124124 */125125- BUG_ON(folio_get_private(folio));125125+ VM_BUG_ON_FOLIO(folio_test_private(folio), folio);126126 folio_attach_private(folio, snapc);127127128128 return ceph_fscache_dirty_folio(mapping, folio);···150150 }151151152152 WARN_ON(!folio_test_locked(folio));153153- if (folio_get_private(folio)) {153153+ if (folio_test_private(folio)) {154154 dout("%p invalidate_folio idx %lu full dirty page\n",155155 inode, folio->index);156156···729729730730 /* clean all pages */731731 for (i = 0; i < req->r_num_ops; i++) {732732- if (req->r_ops[i].op != CEPH_OSD_OP_WRITE)732732+ if (req->r_ops[i].op != CEPH_OSD_OP_WRITE) {733733+ pr_warn("%s incorrect op %d req %p index %d tid %llu\n",734734+ __func__, req->r_ops[i].op, req, i, req->r_tid);733735 break;736736+ }734737735738 osd_data = osd_req_op_extent_osd_data(req, i);736739 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES);
+13-3
fs/ceph/file.c
···629629 iinfo.change_attr = 1;630630 ceph_encode_timespec64(&iinfo.btime, &now);631631632632- iinfo.xattr_len = ARRAY_SIZE(xattr_buf);633633- iinfo.xattr_data = xattr_buf;634634- memset(iinfo.xattr_data, 0, iinfo.xattr_len);632632+ if (req->r_pagelist) {633633+ iinfo.xattr_len = req->r_pagelist->length;634634+ iinfo.xattr_data = req->r_pagelist->mapped_tail;635635+ } else {636636+ /* fake it */637637+ iinfo.xattr_len = ARRAY_SIZE(xattr_buf);638638+ iinfo.xattr_data = xattr_buf;639639+ memset(iinfo.xattr_data, 0, iinfo.xattr_len);640640+ }635641636642 in.ino = cpu_to_le64(vino.ino);637643 in.snapid = cpu_to_le64(CEPH_NOSNAP);···749743 err = ceph_security_init_secctx(dentry, mode, &as_ctx);750744 if (err < 0)751745 goto out_ctx;746746+ /* Async create can't handle more than a page of xattrs */747747+ if (as_ctx.pagelist &&748748+ !list_is_singular(&as_ctx.pagelist->head))749749+ try_async = false;752750 } else if (!d_in_lookup(dentry)) {753751 /* If it's not being looked up, it's negative */754752 return -ENOENT;
···1153115311541154 if (length != written && (iomap->flags & IOMAP_F_NEW)) {11551155 /* Deallocate blocks that were just allocated. */11561156- loff_t blockmask = i_blocksize(inode) - 1;11571157- loff_t end = (pos + length) & ~blockmask;11561156+ loff_t hstart = round_up(pos + written, i_blocksize(inode));11571157+ loff_t hend = iomap->offset + iomap->length;1158115811591159- pos = (pos + written + blockmask) & ~blockmask;11601160- if (pos < end) {11611161- truncate_pagecache_range(inode, pos, end - 1);11621162- punch_hole(ip, pos, end - pos);11591159+ if (hstart < hend) {11601160+ truncate_pagecache_range(inode, hstart, hend - 1);11611161+ punch_hole(ip, hstart, hend - hstart);11631162 }11641163 }11651164
+65-78
fs/gfs2/file.c
···770770 return ret ? ret : ret1;771771}772772773773-static inline bool should_fault_in_pages(ssize_t ret, struct iov_iter *i,773773+static inline bool should_fault_in_pages(struct iov_iter *i,774774+ struct kiocb *iocb,774775 size_t *prev_count,775776 size_t *window_size)776777{777778 size_t count = iov_iter_count(i);778779 size_t size, offs;779780780780- if (likely(!count))781781- return false;782782- if (ret <= 0 && ret != -EFAULT)781781+ if (!count)783782 return false;784783 if (!iter_is_iovec(i))785784 return false;786785787786 size = PAGE_SIZE;788788- offs = offset_in_page(i->iov[0].iov_base + i->iov_offset);787787+ offs = offset_in_page(iocb->ki_pos);789788 if (*prev_count != count || !*window_size) {790789 size_t nr_dirtied;791790792792- size = ALIGN(offs + count, PAGE_SIZE);793793- size = min_t(size_t, size, SZ_1M);794791 nr_dirtied = max(current->nr_dirtied_pause -795792 current->nr_dirtied, 8);796796- size = min(size, nr_dirtied << PAGE_SHIFT);793793+ size = min_t(size_t, SZ_1M, nr_dirtied << PAGE_SHIFT);797794 }798795799796 *prev_count = count;···804807 struct file *file = iocb->ki_filp;805808 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host);806809 size_t prev_count = 0, window_size = 0;807807- size_t written = 0;810810+ size_t read = 0;808811 ssize_t ret;809812810813 /*···832835 ret = gfs2_glock_nq(gh);833836 if (ret)834837 goto out_uninit;835835-retry_under_glock:836838 pagefault_disable();837839 to->nofault = true;838840 ret = iomap_dio_rw(iocb, to, &gfs2_iomap_ops, NULL,839839- IOMAP_DIO_PARTIAL, written);841841+ IOMAP_DIO_PARTIAL, read);840842 to->nofault = false;841843 pagefault_enable();844844+ if (ret <= 0 && ret != -EFAULT)845845+ goto out_unlock;842846 if (ret > 0)843843- written = ret;847847+ read = ret;844848845845- if (should_fault_in_pages(ret, to, &prev_count, &window_size)) {846846- size_t leftover;847847-848848- gfs2_holder_allow_demote(gh);849849- leftover = fault_in_iov_iter_writeable(to, window_size);850850- gfs2_holder_disallow_demote(gh);851851- if (leftover != window_size) {852852- if (gfs2_holder_queued(gh))853853- goto retry_under_glock;849849+ if (should_fault_in_pages(to, iocb, &prev_count, &window_size)) {850850+ gfs2_glock_dq(gh);851851+ window_size -= fault_in_iov_iter_writeable(to, window_size);852852+ if (window_size)854853 goto retry;855855- }856854 }855855+out_unlock:857856 if (gfs2_holder_queued(gh))858857 gfs2_glock_dq(gh);859858out_uninit:860859 gfs2_holder_uninit(gh);861860 if (ret < 0)862861 return ret;863863- return written;862862+ return read;864863}865864866865static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from,···866873 struct inode *inode = file->f_mapping->host;867874 struct gfs2_inode *ip = GFS2_I(inode);868875 size_t prev_count = 0, window_size = 0;869869- size_t read = 0;876876+ size_t written = 0;870877 ssize_t ret;871878872879 /*···894901 goto out_uninit;895902 /* Silently fall back to buffered I/O when writing beyond EOF */896903 if (iocb->ki_pos + iov_iter_count(from) > i_size_read(&ip->i_inode))897897- goto out;898898-retry_under_glock:904904+ goto out_unlock;899905900906 from->nofault = true;901907 ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL,902902- IOMAP_DIO_PARTIAL, read);908908+ IOMAP_DIO_PARTIAL, written);903909 from->nofault = false;904904-905905- if (ret == -ENOTBLK)906906- ret = 0;907907- if (ret > 0)908908- read = ret;909909-910910- if (should_fault_in_pages(ret, from, &prev_count, &window_size)) {911911- size_t leftover;912912-913913- gfs2_holder_allow_demote(gh);914914- leftover = fault_in_iov_iter_readable(from, window_size);915915- gfs2_holder_disallow_demote(gh);916916- if (leftover != window_size) {917917- if (gfs2_holder_queued(gh))918918- goto retry_under_glock;919919- goto retry;920920- }910910+ if (ret <= 0) {911911+ if (ret == -ENOTBLK)912912+ ret = 0;913913+ if (ret != -EFAULT)914914+ goto out_unlock;921915 }922922-out:916916+ if (ret > 0)917917+ written = ret;918918+919919+ if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {920920+ gfs2_glock_dq(gh);921921+ window_size -= fault_in_iov_iter_readable(from, window_size);922922+ if (window_size)923923+ goto retry;924924+ }925925+out_unlock:923926 if (gfs2_holder_queued(gh))924927 gfs2_glock_dq(gh);925928out_uninit:926929 gfs2_holder_uninit(gh);927930 if (ret < 0)928931 return ret;929929- return read;932932+ return written;930933}931934932935static ssize_t gfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *to)···930941 struct gfs2_inode *ip;931942 struct gfs2_holder gh;932943 size_t prev_count = 0, window_size = 0;933933- size_t written = 0;944944+ size_t read = 0;934945 ssize_t ret;935946936947 /*···951962 if (ret >= 0) {952963 if (!iov_iter_count(to))953964 return ret;954954- written = ret;965965+ read = ret;955966 } else if (ret != -EFAULT) {956967 if (ret != -EAGAIN)957968 return ret;···964975 ret = gfs2_glock_nq(&gh);965976 if (ret)966977 goto out_uninit;967967-retry_under_glock:968978 pagefault_disable();969979 ret = generic_file_read_iter(iocb, to);970980 pagefault_enable();981981+ if (ret <= 0 && ret != -EFAULT)982982+ goto out_unlock;971983 if (ret > 0)972972- written += ret;984984+ read += ret;973985974974- if (should_fault_in_pages(ret, to, &prev_count, &window_size)) {975975- size_t leftover;976976-977977- gfs2_holder_allow_demote(&gh);978978- leftover = fault_in_iov_iter_writeable(to, window_size);979979- gfs2_holder_disallow_demote(&gh);980980- if (leftover != window_size) {981981- if (gfs2_holder_queued(&gh))982982- goto retry_under_glock;986986+ if (should_fault_in_pages(to, iocb, &prev_count, &window_size)) {987987+ gfs2_glock_dq(&gh);988988+ window_size -= fault_in_iov_iter_writeable(to, window_size);989989+ if (window_size)983990 goto retry;984984- }985991 }992992+out_unlock:986993 if (gfs2_holder_queued(&gh))987994 gfs2_glock_dq(&gh);988995out_uninit:989996 gfs2_holder_uninit(&gh);990990- return written ? written : ret;997997+ return read ? read : ret;991998}9929999931000static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,···9971012 struct gfs2_holder *statfs_gh = NULL;9981013 size_t prev_count = 0, window_size = 0;9991014 size_t orig_count = iov_iter_count(from);10001000- size_t read = 0;10151015+ size_t written = 0;10011016 ssize_t ret;1002101710031018 /*···1015103010161031 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, gh);10171032retry:10331033+ if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {10341034+ window_size -= fault_in_iov_iter_readable(from, window_size);10351035+ if (!window_size) {10361036+ ret = -EFAULT;10371037+ goto out_uninit;10381038+ }10391039+ from->count = min(from->count, window_size);10401040+ }10181041 ret = gfs2_glock_nq(gh);10191042 if (ret)10201043 goto out_uninit;10211021-retry_under_glock:10441044+10221045 if (inode == sdp->sd_rindex) {10231046 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);10241047···10431050 current->backing_dev_info = NULL;10441051 if (ret > 0) {10451052 iocb->ki_pos += ret;10461046- read += ret;10531053+ written += ret;10471054 }1048105510491056 if (inode == sdp->sd_rindex)10501057 gfs2_glock_dq_uninit(statfs_gh);1051105810521052- from->count = orig_count - read;10531053- if (should_fault_in_pages(ret, from, &prev_count, &window_size)) {10541054- size_t leftover;10591059+ if (ret <= 0 && ret != -EFAULT)10601060+ goto out_unlock;1055106110561056- gfs2_holder_allow_demote(gh);10571057- leftover = fault_in_iov_iter_readable(from, window_size);10581058- gfs2_holder_disallow_demote(gh);10591059- if (leftover != window_size) {10601060- from->count = min(from->count, window_size - leftover);10611061- if (gfs2_holder_queued(gh))10621062- goto retry_under_glock;10631063- goto retry;10641064- }10621062+ from->count = orig_count - written;10631063+ if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {10641064+ gfs2_glock_dq(gh);10651065+ goto retry;10651066 }10661067out_unlock:10671068 if (gfs2_holder_queued(gh))···10641077 gfs2_holder_uninit(gh);10651078 if (statfs_gh)10661079 kfree(statfs_gh);10671067- from->count = orig_count - read;10681068- return read ? read : ret;10801080+ from->count = orig_count - written;10811081+ return written ? written : ret;10691082}1070108310711084/**
+1-1
fs/nfs/fs_context.c
···517517 if (result.negated)518518 ctx->flags &= ~NFS_MOUNT_SOFTREVAL;519519 else520520- ctx->flags &= NFS_MOUNT_SOFTREVAL;520520+ ctx->flags |= NFS_MOUNT_SOFTREVAL;521521 break;522522 case Opt_posix:523523 if (result.negated)
+13
fs/notify/fanotify/fanotify_user.c
···16571657 else16581658 mnt = path.mnt;1659165916601660+ /*16611661+ * FAN_RENAME is not allowed on non-dir (for now).16621662+ * We shouldn't have allowed setting any dirent events in mask of16631663+ * non-dir, but because we always allowed it, error only if group16641664+ * was initialized with the new flag FAN_REPORT_TARGET_FID.16651665+ */16661666+ ret = -ENOTDIR;16671667+ if (inode && !S_ISDIR(inode->i_mode) &&16681668+ ((mask & FAN_RENAME) ||16691669+ ((mask & FANOTIFY_DIRENT_EVENTS) &&16701670+ FAN_GROUP_FLAG(group, FAN_REPORT_TARGET_FID))))16711671+ goto path_put_and_out;16721672+16601673 /* Mask out FAN_EVENT_ON_CHILD flag for sb/mount/non-dir marks */16611674 if (mnt || !S_ISDIR(inode->i_mode)) {16621675 mask &= ~FAN_EVENT_ON_CHILD;
+22-1
fs/proc/fd.c
···7272 return 0;7373}74747575-static int seq_fdinfo_open(struct inode *inode, struct file *file)7575+static int proc_fdinfo_access_allowed(struct inode *inode)7676{7777 bool allowed = false;7878 struct task_struct *task = get_proc_task(inode);···85858686 if (!allowed)8787 return -EACCES;8888+8989+ return 0;9090+}9191+9292+static int seq_fdinfo_open(struct inode *inode, struct file *file)9393+{9494+ int ret = proc_fdinfo_access_allowed(inode);9595+9696+ if (ret)9797+ return ret;88988999 return single_open(file, seq_show, inode);90100}···358348 proc_fdinfo_instantiate);359349}360350351351+static int proc_open_fdinfo(struct inode *inode, struct file *file)352352+{353353+ int ret = proc_fdinfo_access_allowed(inode);354354+355355+ if (ret)356356+ return ret;357357+358358+ return 0;359359+}360360+361361const struct inode_operations proc_fdinfo_inode_operations = {362362 .lookup = proc_lookupfdinfo,363363 .setattr = proc_setattr,364364};365365366366const struct file_operations proc_fdinfo_operations = {367367+ .open = proc_open_fdinfo,367368 .read = generic_read_dir,368369 .iterate_shared = proc_readfdinfo,369370 .llseek = generic_file_llseek,
···169169#define NETIF_F_HW_HSR_FWD __NETIF_F(HW_HSR_FWD)170170#define NETIF_F_HW_HSR_DUP __NETIF_F(HW_HSR_DUP)171171172172-/* Finds the next feature with the highest number of the range of start till 0.172172+/* Finds the next feature with the highest number of the range of start-1 till 0.173173 */174174static inline int find_next_netdev_feature(u64 feature, unsigned long start)175175{···188188 for ((bit) = find_next_netdev_feature((mask_addr), \189189 NETDEV_FEATURE_COUNT); \190190 (bit) >= 0; \191191- (bit) = find_next_netdev_feature((mask_addr), (bit) - 1))191191+ (bit) = find_next_netdev_feature((mask_addr), (bit)))192192193193/* Features valid for ethtool to change */194194/* = all defined minus driver/device-class-related */
···33903390 */33913391void __init cpuset_init_smp(void)33923392{33933393- cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask);33943394- top_cpuset.mems_allowed = node_states[N_MEMORY];33933393+ /*33943394+ * cpus_allowd/mems_allowed set to v2 values in the initial33953395+ * cpuset_bind() call will be reset to v1 values in another33963396+ * cpuset_bind() call when v1 cpuset is mounted.33973397+ */33953398 top_cpuset.old_mems_allowed = top_cpuset.mems_allowed;3396339933973400 cpumask_copy(top_cpuset.effective_cpus, cpu_active_mask);
···621621 * fails for the first page, and therefore expect addr==__kfence_pool in622622 * most failure cases.623623 */624624+ for (char *p = (char *)addr; p < __kfence_pool + KFENCE_POOL_SIZE; p += PAGE_SIZE) {625625+ struct slab *slab = virt_to_slab(p);626626+627627+ if (!slab)628628+ continue;629629+#ifdef CONFIG_MEMCG630630+ slab->memcg_data = 0;631631+#endif632632+ __folio_clear_slab(slab_folio(slab));633633+ }624634 memblock_free_late(__pa(addr), KFENCE_POOL_SIZE - (addr - (unsigned long)__kfence_pool));625635 __kfence_pool = NULL;626636 return false;
+1-14
mm/memory-failure.c
···12741274 }12751275out:12761276 if (ret == -EIO)12771277- dump_page(p, "hwpoison: unhandlable page");12771277+ pr_err("Memory failure: %#lx: unhandlable page.\n", page_to_pfn(p));1278127812791279 return ret;12801280}···18601860 }1861186118621862 if (PageTransHuge(hpage)) {18631863- /*18641864- * Bail out before SetPageHasHWPoisoned() if hpage is18651865- * huge_zero_page, although PG_has_hwpoisoned is not18661866- * checked in set_huge_zero_page().18671867- *18681868- * TODO: Handle memory failure of huge_zero_page thoroughly.18691869- */18701870- if (is_huge_zero_page(hpage)) {18711871- action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED);18721872- res = -EBUSY;18731873- goto unlock_mutex;18741874- }18751875-18761863 /*18771864 * The flag must be set after the refcount is bumped18781865 * otherwise it may race with THP split.
···475475 goto free_skb;476476 }477477478478+ /* GRO might have added fragments to the fragment list instead of479479+ * frags[]. But this is not handled by skb_split and must be480480+ * linearized to avoid incorrect length information after all481481+ * batman-adv fragments were created and submitted to the482482+ * hard-interface483483+ */484484+ if (skb_has_frag_list(skb) && __skb_linearize(skb)) {485485+ ret = -ENOMEM;486486+ goto free_skb;487487+ }488488+478489 /* Create one header to be copied to all fragments */479490 frag_header.packet_type = BATADV_UNICAST_FRAG;480491 frag_header.version = BATADV_COMPAT_VERSION;
+3-3
net/bluetooth/hci_core.c
···25552555 */25562556 switch (hdev->dev_type) {25572557 case HCI_PRIMARY:25582558- id = ida_simple_get(&hci_index_ida, 0, 0, GFP_KERNEL);25582558+ id = ida_simple_get(&hci_index_ida, 0, HCI_MAX_ID, GFP_KERNEL);25592559 break;25602560 case HCI_AMP:25612561- id = ida_simple_get(&hci_index_ida, 1, 0, GFP_KERNEL);25612561+ id = ida_simple_get(&hci_index_ida, 1, HCI_MAX_ID, GFP_KERNEL);25622562 break;25632563 default:25642564 return -EINVAL;···25672567 if (id < 0)25682568 return id;2569256925702570- sprintf(hdev->name, "hci%d", id);25702570+ snprintf(hdev->name, sizeof(hdev->name), "hci%d", id);25712571 hdev->id = id;2572257225732573 BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
···426426 if (!dn_db->router) {427427 dn_db->router = neigh_clone(neigh);428428 } else {429429- if (msg->priority > ((struct dn_neigh *)dn_db->router)->priority)429429+ if (msg->priority > container_of(dn_db->router,430430+ struct dn_neigh, n)->priority)430431 neigh_release(xchg(&dn_db->router, neigh_clone(neigh)));431432 }432433 }
+2-2
net/decnet/dn_route.c
···11201120 /* Ok then, we assume its directly connected and move on */11211121select_source:11221122 if (neigh)11231123- gateway = ((struct dn_neigh *)neigh)->addr;11231123+ gateway = container_of(neigh, struct dn_neigh, n)->addr;11241124 if (gateway == 0)11251125 gateway = fld.daddr;11261126 if (fld.saddr == 0) {···14291429 /* Use the default router if there is one */14301430 neigh = neigh_clone(dn_db->router);14311431 if (neigh) {14321432- gateway = ((struct dn_neigh *)neigh)->addr;14321432+ gateway = container_of(neigh, struct dn_neigh, n)->addr;14331433 goto make_route;14341434 }14351435
···14051405 goto dont_reorder;1406140614071407 /* not part of a BA session */14081408- if (ack_policy != IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK &&14091409- ack_policy != IEEE80211_QOS_CTL_ACK_POLICY_NORMAL)14081408+ if (ack_policy == IEEE80211_QOS_CTL_ACK_POLICY_NOACK)14101409 goto dont_reorder;1411141014121411 /* new, potentially un-ordered, ampdu frame - process it */
···124124 if (ret < 0)125125 goto out;126126127127- rds_tcp_tune(sock);127127+ if (!rds_tcp_tune(sock)) {128128+ ret = -EINVAL;129129+ goto out;130130+ }128131129132 if (isv6) {130133 sin6.sin6_family = AF_INET6;
+4-1
net/rds/tcp_listen.c
···133133 __module_get(new_sock->ops->owner);134134135135 rds_tcp_keepalive(new_sock);136136- rds_tcp_tune(new_sock);136136+ if (!rds_tcp_tune(new_sock)) {137137+ ret = -EINVAL;138138+ goto out;139139+ }137140138141 inet = inet_sk(new_sock->sk);139142
+22-4
net/sched/act_pedit.c
···149149 struct nlattr *pattr;150150 struct tcf_pedit *p;151151 int ret = 0, err;152152- int ksize;152152+ int i, ksize;153153 u32 index;154154155155 if (!nla) {···228228 p->tcfp_nkeys = parm->nkeys;229229 }230230 memcpy(p->tcfp_keys, parm->keys, ksize);231231+ p->tcfp_off_max_hint = 0;232232+ for (i = 0; i < p->tcfp_nkeys; ++i) {233233+ u32 cur = p->tcfp_keys[i].off;234234+235235+ /* The AT option can read a single byte, we can bound the actual236236+ * value with uchar max.237237+ */238238+ cur += (0xff & p->tcfp_keys[i].offmask) >> p->tcfp_keys[i].shift;239239+240240+ /* Each key touches 4 bytes starting from the computed offset */241241+ p->tcfp_off_max_hint = max(p->tcfp_off_max_hint, cur + 4);242242+ }231243232244 p->tcfp_flags = parm->flags;233245 goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);···320308 struct tcf_result *res)321309{322310 struct tcf_pedit *p = to_pedit(a);311311+ u32 max_offset;323312 int i;324313325325- if (skb_unclone(skb, GFP_ATOMIC))326326- return p->tcf_action;327327-328314 spin_lock(&p->tcf_lock);315315+316316+ max_offset = (skb_transport_header_was_set(skb) ?317317+ skb_transport_offset(skb) :318318+ skb_network_offset(skb)) +319319+ p->tcfp_off_max_hint;320320+ if (skb_ensure_writable(skb, min(skb->len, max_offset)))321321+ goto unlock;329322330323 tcf_lastuse_update(&p->tcf_tm);331324···420403 p->tcf_qstats.overlimits++;421404done:422405 bstats_update(&p->tcf_bstats, skb);406406+unlock:423407 spin_unlock(&p->tcf_lock);424408 return p->tcf_action;425409}
···9797 * timeout, which would result in reconnections being9898 * done without the correct namespace:9999 */100100- .flags = RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL |100100+ .flags = RPC_CLNT_CREATE_NOPING |101101+ RPC_CLNT_CREATE_CONNECTED |101102 RPC_CLNT_CREATE_NO_IDLE_TIMEOUT102103 };103104 struct rpc_clnt *clnt;
+33-3
net/sunrpc/clnt.c
···7676static int rpc_decode_header(struct rpc_task *task,7777 struct xdr_stream *xdr);7878static int rpc_ping(struct rpc_clnt *clnt);7979+static int rpc_ping_noreply(struct rpc_clnt *clnt);7980static void rpc_check_timeout(struct rpc_task *task);80818182static void rpc_register_client(struct rpc_clnt *clnt)···480479481480 if (!(args->flags & RPC_CLNT_CREATE_NOPING)) {482481 int err = rpc_ping(clnt);483483- if ((args->flags & RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL) &&484484- err == -EOPNOTSUPP)485485- err = 0;482482+ if (err != 0) {483483+ rpc_shutdown_client(clnt);484484+ return ERR_PTR(err);485485+ }486486+ } else if (args->flags & RPC_CLNT_CREATE_CONNECTED) {487487+ int err = rpc_ping_noreply(clnt);486488 if (err != 0) {487489 rpc_shutdown_client(clnt);488490 return ERR_PTR(err);···27162712 .p_decode = rpcproc_decode_null,27172713};2718271427152715+static const struct rpc_procinfo rpcproc_null_noreply = {27162716+ .p_encode = rpcproc_encode_null,27172717+};27182718+27192719static void27202720rpc_null_call_prepare(struct rpc_task *task, void *data)27212721{···27662758 int status;2767275927682760 task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL);27612761+ if (IS_ERR(task))27622762+ return PTR_ERR(task);27632763+ status = task->tk_status;27642764+ rpc_put_task(task);27652765+ return status;27662766+}27672767+27682768+static int rpc_ping_noreply(struct rpc_clnt *clnt)27692769+{27702770+ struct rpc_message msg = {27712771+ .rpc_proc = &rpcproc_null_noreply,27722772+ };27732773+ struct rpc_task_setup task_setup_data = {27742774+ .rpc_client = clnt,27752775+ .rpc_message = &msg,27762776+ .callback_ops = &rpc_null_ops,27772777+ .flags = RPC_TASK_SOFT | RPC_TASK_SOFTCONN | RPC_TASK_NULLCREDS,27782778+ };27792779+ struct rpc_task *task;27802780+ int status;27812781+27822782+ task = rpc_run_task(&task_setup_data);27692783 if (IS_ERR(task))27702784 return PTR_ERR(task);27712785 status = task->tk_status;
+3
net/tls/tls_device.c
···1347134713481348 /* Device contexts for RX and TX will be freed in on sk_destruct13491349 * by tls_device_free_ctx. rx_conf and tx_conf stay in TLS_HW.13501350+ * Now release the ref taken above.13501351 */13521352+ if (refcount_dec_and_test(&ctx->refcount))13531353+ tls_device_free_ctx(ctx);13511354 }1352135513531356 up_write(&device_offload_lock);
+16-2
net/wireless/nl80211.c
···31733173 } else if (attrs[NL80211_ATTR_CHANNEL_WIDTH]) {31743174 chandef->width =31753175 nla_get_u32(attrs[NL80211_ATTR_CHANNEL_WIDTH]);31763176+ if (chandef->chan->band == NL80211_BAND_S1GHZ) {31773177+ /* User input error for channel width doesn't match channel */31783178+ if (chandef->width != ieee80211_s1g_channel_width(chandef->chan)) {31793179+ NL_SET_ERR_MSG_ATTR(extack,31803180+ attrs[NL80211_ATTR_CHANNEL_WIDTH],31813181+ "bad channel width");31823182+ return -EINVAL;31833183+ }31843184+ }31763185 if (attrs[NL80211_ATTR_CENTER_FREQ1]) {31773186 chandef->center_freq1 =31783187 nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ1]);···1166611657 struct cfg80211_bitrate_mask mask;1166711658 struct cfg80211_registered_device *rdev = info->user_ptr[0];1166811659 struct net_device *dev = info->user_ptr[1];1166011660+ struct wireless_dev *wdev = dev->ieee80211_ptr;1166911661 int err;11670116621167111663 if (!rdev->ops->set_bitrate_mask)1167211664 return -EOPNOTSUPP;11673116651166611666+ wdev_lock(wdev);1167411667 err = nl80211_parse_tx_bitrate_mask(info, info->attrs,1167511668 NL80211_ATTR_TX_RATES, &mask,1167611669 dev, true);1167711670 if (err)1167811678- return err;1167111671+ goto out;11679116721168011680- return rdev_set_bitrate_mask(rdev, dev, NULL, &mask);1167311673+ err = rdev_set_bitrate_mask(rdev, dev, NULL, &mask);1167411674+out:1167511675+ wdev_unlock(wdev);1167611676+ return err;1168111677}11682116781168311679static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
···2525 * that the custom event is using.2626 */2727 TP_PROTO(bool preempt,2828- unsigned int prev_state,2928 struct task_struct *prev,3030- struct task_struct *next),2929+ struct task_struct *next,3030+ unsigned int prev_state),31313232- TP_ARGS(preempt, prev_state, prev, next),3232+ TP_ARGS(preempt, prev, next, prev_state),33333434 /*3535 * The next fields are where the customization happens.
···311311312312 /* BUG_ON due to failure in allocation of orig_mask/mask */313313 BUG_ON(-1);314314+ return NULL;314315}315316316317static cpu_set_t *bind_to_node(int target_node)···365364366365 /* BUG_ON due to failure in allocation of orig_mask/mask */367366 BUG_ON(-1);367367+ return NULL;368368}369369370370static void bind_to_cpumask(cpu_set_t *mask)
···11+// SPDX-License-Identifier: GPL-2.0-only22+/*33+ * This code is taken from the Android Open Source Project and the author44+ * (Maciej Żenczykowski) has gave permission to relicense it under the55+ * GPLv2. Therefore this program is free software;66+ * You can redistribute it and/or modify it under the terms of the GNU77+ * General Public License version 2 as published by the Free Software88+ * Foundation99+1010+ * The original headers, including the original license headers, are1111+ * included below for completeness.1212+ *1313+ * Copyright (C) 2019 The Android Open Source Project1414+ *1515+ * Licensed under the Apache License, Version 2.0 (the "License");1616+ * you may not use this file except in compliance with the License.1717+ * You may obtain a copy of the License at1818+ *1919+ * http://www.apache.org/licenses/LICENSE-2.02020+ *2121+ * Unless required by applicable law or agreed to in writing, software2222+ * distributed under the License is distributed on an "AS IS" BASIS,2323+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.2424+ * See the License for the specific language governing permissions and2525+ * limitations under the License.2626+ */2727+#include <linux/bpf.h>2828+#include <linux/if.h>2929+#include <linux/if_ether.h>3030+#include <linux/if_packet.h>3131+#include <linux/in.h>3232+#include <linux/in6.h>3333+#include <linux/ip.h>3434+#include <linux/ipv6.h>3535+#include <linux/pkt_cls.h>3636+#include <linux/swab.h>3737+#include <stdbool.h>3838+#include <stdint.h>3939+4040+4141+#include <linux/udp.h>4242+4343+#include <bpf/bpf_helpers.h>4444+#include <bpf/bpf_endian.h>4545+4646+#define IP_DF 0x4000 // Flag: "Don't Fragment"4747+4848+SEC("schedcls/ingress6/nat_6")4949+int sched_cls_ingress6_nat_6_prog(struct __sk_buff *skb)5050+{5151+ const int l2_header_size = sizeof(struct ethhdr);5252+ void *data = (void *)(long)skb->data;5353+ const void *data_end = (void *)(long)skb->data_end;5454+ const struct ethhdr * const eth = data; // used iff is_ethernet5555+ const struct ipv6hdr * const ip6 = (void *)(eth + 1);5656+5757+ // Require ethernet dst mac address to be our unicast address.5858+ if (skb->pkt_type != PACKET_HOST)5959+ return TC_ACT_OK;6060+6161+ // Must be meta-ethernet IPv6 frame6262+ if (skb->protocol != bpf_htons(ETH_P_IPV6))6363+ return TC_ACT_OK;6464+6565+ // Must have (ethernet and) ipv6 header6666+ if (data + l2_header_size + sizeof(*ip6) > data_end)6767+ return TC_ACT_OK;6868+6969+ // Ethertype - if present - must be IPv67070+ if (eth->h_proto != bpf_htons(ETH_P_IPV6))7171+ return TC_ACT_OK;7272+7373+ // IP version must be 67474+ if (ip6->version != 6)7575+ return TC_ACT_OK;7676+ // Maximum IPv6 payload length that can be translated to IPv47777+ if (bpf_ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr))7878+ return TC_ACT_OK;7979+ switch (ip6->nexthdr) {8080+ case IPPROTO_TCP: // For TCP & UDP the checksum neutrality of the chosen IPv68181+ case IPPROTO_UDP: // address means there is no need to update their checksums.8282+ case IPPROTO_GRE: // We do not need to bother looking at GRE/ESP headers,8383+ case IPPROTO_ESP: // since there is never a checksum to update.8484+ break;8585+ default: // do not know how to handle anything else8686+ return TC_ACT_OK;8787+ }8888+8989+ struct ethhdr eth2; // used iff is_ethernet9090+9191+ eth2 = *eth; // Copy over the ethernet header (src/dst mac)9292+ eth2.h_proto = bpf_htons(ETH_P_IP); // But replace the ethertype9393+9494+ struct iphdr ip = {9595+ .version = 4, // u49696+ .ihl = sizeof(struct iphdr) / sizeof(__u32), // u49797+ .tos = (ip6->priority << 4) + (ip6->flow_lbl[0] >> 4), // u89898+ .tot_len = bpf_htons(bpf_ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u169999+ .id = 0, // u16100100+ .frag_off = bpf_htons(IP_DF), // u16101101+ .ttl = ip6->hop_limit, // u8102102+ .protocol = ip6->nexthdr, // u8103103+ .check = 0, // u16104104+ .saddr = 0x0201a8c0, // u32105105+ .daddr = 0x0101a8c0, // u32106106+ };107107+108108+ // Calculate the IPv4 one's complement checksum of the IPv4 header.109109+ __wsum sum4 = 0;110110+111111+ for (int i = 0; i < sizeof(ip) / sizeof(__u16); ++i)112112+ sum4 += ((__u16 *)&ip)[i];113113+114114+ // Note that sum4 is guaranteed to be non-zero by virtue of ip.version == 4115115+ sum4 = (sum4 & 0xFFFF) + (sum4 >> 16); // collapse u32 into range 1 .. 0x1FFFE116116+ sum4 = (sum4 & 0xFFFF) + (sum4 >> 16); // collapse any potential carry into u16117117+ ip.check = (__u16)~sum4; // sum4 cannot be zero, so this is never 0xFFFF118118+119119+ // Calculate the *negative* IPv6 16-bit one's complement checksum of the IPv6 header.120120+ __wsum sum6 = 0;121121+ // We'll end up with a non-zero sum due to ip6->version == 6 (which has '0' bits)122122+ for (int i = 0; i < sizeof(*ip6) / sizeof(__u16); ++i)123123+ sum6 += ~((__u16 *)ip6)[i]; // note the bitwise negation124124+125125+ // Note that there is no L4 checksum update: we are relying on the checksum neutrality126126+ // of the ipv6 address chosen by netd's ClatdController.127127+128128+ // Packet mutations begin - point of no return, but if this first modification fails129129+ // the packet is probably still pristine, so let clatd handle it.130130+ if (bpf_skb_change_proto(skb, bpf_htons(ETH_P_IP), 0))131131+ return TC_ACT_OK;132132+ bpf_csum_update(skb, sum6);133133+134134+ data = (void *)(long)skb->data;135135+ data_end = (void *)(long)skb->data_end;136136+ if (data + l2_header_size + sizeof(struct iphdr) > data_end)137137+ return TC_ACT_SHOT;138138+139139+ struct ethhdr *new_eth = data;140140+141141+ // Copy over the updated ethernet header142142+ *new_eth = eth2;143143+144144+ // Copy over the new ipv4 header.145145+ *(struct iphdr *)(new_eth + 1) = ip;146146+ return bpf_redirect(skb->ifindex, BPF_F_INGRESS);147147+}148148+149149+SEC("schedcls/egress4/snat4")150150+int sched_cls_egress4_snat4_prog(struct __sk_buff *skb)151151+{152152+ const int l2_header_size = sizeof(struct ethhdr);153153+ void *data = (void *)(long)skb->data;154154+ const void *data_end = (void *)(long)skb->data_end;155155+ const struct ethhdr *const eth = data; // used iff is_ethernet156156+ const struct iphdr *const ip4 = (void *)(eth + 1);157157+158158+ // Must be meta-ethernet IPv4 frame159159+ if (skb->protocol != bpf_htons(ETH_P_IP))160160+ return TC_ACT_OK;161161+162162+ // Must have ipv4 header163163+ if (data + l2_header_size + sizeof(struct ipv6hdr) > data_end)164164+ return TC_ACT_OK;165165+166166+ // Ethertype - if present - must be IPv4167167+ if (eth->h_proto != bpf_htons(ETH_P_IP))168168+ return TC_ACT_OK;169169+170170+ // IP version must be 4171171+ if (ip4->version != 4)172172+ return TC_ACT_OK;173173+174174+ // We cannot handle IP options, just standard 20 byte == 5 dword minimal IPv4 header175175+ if (ip4->ihl != 5)176176+ return TC_ACT_OK;177177+178178+ // Maximum IPv6 payload length that can be translated to IPv4179179+ if (bpf_htons(ip4->tot_len) > 0xFFFF - sizeof(struct ipv6hdr))180180+ return TC_ACT_OK;181181+182182+ // Calculate the IPv4 one's complement checksum of the IPv4 header.183183+ __wsum sum4 = 0;184184+185185+ for (int i = 0; i < sizeof(*ip4) / sizeof(__u16); ++i)186186+ sum4 += ((__u16 *)ip4)[i];187187+188188+ // Note that sum4 is guaranteed to be non-zero by virtue of ip4->version == 4189189+ sum4 = (sum4 & 0xFFFF) + (sum4 >> 16); // collapse u32 into range 1 .. 0x1FFFE190190+ sum4 = (sum4 & 0xFFFF) + (sum4 >> 16); // collapse any potential carry into u16191191+ // for a correct checksum we should get *a* zero, but sum4 must be positive, ie 0xFFFF192192+ if (sum4 != 0xFFFF)193193+ return TC_ACT_OK;194194+195195+ // Minimum IPv4 total length is the size of the header196196+ if (bpf_ntohs(ip4->tot_len) < sizeof(*ip4))197197+ return TC_ACT_OK;198198+199199+ // We are incapable of dealing with IPv4 fragments200200+ if (ip4->frag_off & ~bpf_htons(IP_DF))201201+ return TC_ACT_OK;202202+203203+ switch (ip4->protocol) {204204+ case IPPROTO_TCP: // For TCP & UDP the checksum neutrality of the chosen IPv6205205+ case IPPROTO_GRE: // address means there is no need to update their checksums.206206+ case IPPROTO_ESP: // We do not need to bother looking at GRE/ESP headers,207207+ break; // since there is never a checksum to update.208208+209209+ case IPPROTO_UDP: // See above comment, but must also have UDP header...210210+ if (data + sizeof(*ip4) + sizeof(struct udphdr) > data_end)211211+ return TC_ACT_OK;212212+ const struct udphdr *uh = (const struct udphdr *)(ip4 + 1);213213+ // If IPv4/UDP checksum is 0 then fallback to clatd so it can calculate the214214+ // checksum. Otherwise the network or more likely the NAT64 gateway might215215+ // drop the packet because in most cases IPv6/UDP packets with a zero checksum216216+ // are invalid. See RFC 6935. TODO: calculate checksum via bpf_csum_diff()217217+ if (!uh->check)218218+ return TC_ACT_OK;219219+ break;220220+221221+ default: // do not know how to handle anything else222222+ return TC_ACT_OK;223223+ }224224+ struct ethhdr eth2; // used iff is_ethernet225225+226226+ eth2 = *eth; // Copy over the ethernet header (src/dst mac)227227+ eth2.h_proto = bpf_htons(ETH_P_IPV6); // But replace the ethertype228228+229229+ struct ipv6hdr ip6 = {230230+ .version = 6, // __u8:4231231+ .priority = ip4->tos >> 4, // __u8:4232232+ .flow_lbl = {(ip4->tos & 0xF) << 4, 0, 0}, // __u8[3]233233+ .payload_len = bpf_htons(bpf_ntohs(ip4->tot_len) - 20), // __be16234234+ .nexthdr = ip4->protocol, // __u8235235+ .hop_limit = ip4->ttl, // __u8236236+ };237237+ ip6.saddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);238238+ ip6.saddr.in6_u.u6_addr32[1] = 0;239239+ ip6.saddr.in6_u.u6_addr32[2] = 0;240240+ ip6.saddr.in6_u.u6_addr32[3] = bpf_htonl(1);241241+ ip6.daddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);242242+ ip6.daddr.in6_u.u6_addr32[1] = 0;243243+ ip6.daddr.in6_u.u6_addr32[2] = 0;244244+ ip6.daddr.in6_u.u6_addr32[3] = bpf_htonl(2);245245+246246+ // Calculate the IPv6 16-bit one's complement checksum of the IPv6 header.247247+ __wsum sum6 = 0;248248+ // We'll end up with a non-zero sum due to ip6.version == 6249249+ for (int i = 0; i < sizeof(ip6) / sizeof(__u16); ++i)250250+ sum6 += ((__u16 *)&ip6)[i];251251+252252+ // Packet mutations begin - point of no return, but if this first modification fails253253+ // the packet is probably still pristine, so let clatd handle it.254254+ if (bpf_skb_change_proto(skb, bpf_htons(ETH_P_IPV6), 0))255255+ return TC_ACT_OK;256256+257257+ // This takes care of updating the skb->csum field for a CHECKSUM_COMPLETE packet.258258+ // In such a case, skb->csum is a 16-bit one's complement sum of the entire payload,259259+ // thus we need to subtract out the ipv4 header's sum, and add in the ipv6 header's sum.260260+ // However, we've already verified the ipv4 checksum is correct and thus 0.261261+ // Thus we only need to add the ipv6 header's sum.262262+ //263263+ // bpf_csum_update() always succeeds if the skb is CHECKSUM_COMPLETE and returns an error264264+ // (-ENOTSUPP) if it isn't. So we just ignore the return code (see above for more details).265265+ bpf_csum_update(skb, sum6);266266+267267+ // bpf_skb_change_proto() invalidates all pointers - reload them.268268+ data = (void *)(long)skb->data;269269+ data_end = (void *)(long)skb->data_end;270270+271271+ // I cannot think of any valid way for this error condition to trigger, however I do272272+ // believe the explicit check is required to keep the in kernel ebpf verifier happy.273273+ if (data + l2_header_size + sizeof(ip6) > data_end)274274+ return TC_ACT_SHOT;275275+276276+ struct ethhdr *new_eth = data;277277+278278+ // Copy over the updated ethernet header279279+ *new_eth = eth2;280280+ // Copy over the new ipv4 header.281281+ *(struct ipv6hdr *)(new_eth + 1) = ip6;282282+ return TC_ACT_OK;283283+}284284+285285+char _license[] SEC("license") = ("GPL");