···66886688 0: no polling (default)6689668966906690 thp_anon= [KNL]66916691- Format: <size>,<size>[KMG]:<state>;<size>-<size>[KMG]:<state>66916691+ Format: <size>[KMG],<size>[KMG]:<state>;<size>[KMG]-<size>[KMG]:<state>66926692 state is one of "always", "madvise", "never" or "inherit".66936693 Control the default behavior of the system with respect66946694 to anonymous transparent hugepages.
+1-1
Documentation/admin-guide/mm/transhuge.rst
···303303kernel command line.304304305305Alternatively, each supported anonymous THP size can be controlled by306306-passing ``thp_anon=<size>,<size>[KMG]:<state>;<size>-<size>[KMG]:<state>``,306306+passing ``thp_anon=<size>[KMG],<size>[KMG]:<state>;<size>[KMG]-<size>[KMG]:<state>``,307307where ``<size>`` is the THP size (must be a power of 2 of PAGE_SIZE and308308supported anonymous THP) and ``<state>`` is one of ``always``, ``madvise``,309309``never`` or ``inherit``.
···124124 atomic mode of operation, even if requested.125125 default: 0126126127127- max-rx-timeout-ms:127127+ arm,max-rx-timeout-ms:128128 description:129129 An optional time value, expressed in milliseconds, representing the130130 transport maximum timeout value for the receive channel. The value should
···121121122122On the other hand, when using PDU1 format, the PS-field contains a so-called123123Destination Address, which is _not_ part of the PGN. When communicating a PGN124124-from user space to kernel (or vice versa) and PDU2 format is used, the PS-field124124+from user space to kernel (or vice versa) and PDU1 format is used, the PS-field125125of the PGN shall be set to zero. The Destination Address shall be set126126elsewhere.127127
···22142214 bool "ARM Scalable Matrix Extension support"22152215 default y22162216 depends on ARM64_SVE22172217+ depends on BROKEN22172218 help22182219 The Scalable Matrix Extension (SME) is an extension to the AArch6422192220 execution state which utilises a substantial subset of the SVE
···6677#ifndef BUILD_VDSO88#include <linux/compiler.h>99+#include <linux/fs.h>1010+#include <linux/shmem_fs.h>911#include <linux/types.h>10121113static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot,···3331}3432#define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey)35333636-static inline unsigned long arch_calc_vm_flag_bits(unsigned long flags)3434+static inline unsigned long arch_calc_vm_flag_bits(struct file *file,3535+ unsigned long flags)3736{3837 /*3938 * Only allow MTE on anonymous mappings as these are guaranteed to be4039 * backed by tags-capable memory. The vm_flags may be overridden by a4140 * filesystem supporting MTE (RAM-based).4241 */4343- if (system_supports_mte() && (flags & MAP_ANONYMOUS))4242+ if (system_supports_mte() &&4343+ ((flags & MAP_ANONYMOUS) || shmem_file(file)))4444 return VM_MTE_ALLOWED;45454646 return 0;4747}4848-#define arch_calc_vm_flag_bits(flags) arch_calc_vm_flag_bits(flags)4848+#define arch_calc_vm_flag_bits(file, flags) arch_calc_vm_flag_bits(file, flags)49495050static inline bool arch_validate_prot(unsigned long prot,5151 unsigned long addr __always_unused)
···7788#include <asm/asm-offsets.h>99#include <asm/assembler.h>1010-#include <asm/thread_info.h>1111-1212-/*1313- * If we have SMCCC v1.3 and (as is likely) no SVE state in1414- * the registers then set the SMCCC hint bit to say there's no1515- * need to preserve it. Do this by directly adjusting the SMCCC1616- * function value which is already stored in x0 ready to be called.1717- */1818-SYM_FUNC_START(__arm_smccc_sve_check)1919-2020- ldr_l x16, smccc_has_sve_hint2121- cbz x16, 2f2222-2323- get_current_task x162424- ldr x16, [x16, #TSK_TI_FLAGS]2525- tbnz x16, #TIF_FOREIGN_FPSTATE, 1f // Any live FP state?2626- tbnz x16, #TIF_SVE, 2f // Does that state include SVE?2727-2828-1: orr x0, x0, ARM_SMCCC_1_3_SVE_HINT2929-3030-2: ret3131-SYM_FUNC_END(__arm_smccc_sve_check)3232-EXPORT_SYMBOL(__arm_smccc_sve_check)33103411 .macro SMCCC instr3535- stp x29, x30, [sp, #-16]!3636- mov x29, sp3737-alternative_if ARM64_SVE3838- bl __arm_smccc_sve_check3939-alternative_else_nop_endif4012 \instr #04141- ldr x4, [sp, #16]1313+ ldr x4, [sp]4214 stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]4315 stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]4444- ldr x4, [sp, #24]1616+ ldr x4, [sp, #8]4517 cbz x4, 1f /* no quirk structure */4618 ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]4719 cmp x9, #ARM_SMCCC_QUIRK_QCOM_A64820 b.ne 1f4921 str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]5050-1: ldp x29, x30, [sp], #165151- ret2222+1: ret5223 .endm53245425/*
+3-2
arch/parisc/include/asm/mman.h
···22#ifndef __ASM_MMAN_H__33#define __ASM_MMAN_H__4455+#include <linux/fs.h>56#include <uapi/asm/mman.h>6778/* PARISC cannot allow mdwe as it needs writable stacks */···1211}1312#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported14131515-static inline unsigned long arch_calc_vm_flag_bits(unsigned long flags)1414+static inline unsigned long arch_calc_vm_flag_bits(struct file *file, unsigned long flags)1615{1716 /*1817 * The stack on parisc grows upwards, so if userspace requests memory···24232524 return 0;2625}2727-#define arch_calc_vm_flag_bits(flags) arch_calc_vm_flag_bits(flags)2626+#define arch_calc_vm_flag_bits(file, flags) arch_calc_vm_flag_bits(file, flags)28272928#endif /* __ASM_MMAN_H__ */
+12
arch/powerpc/kvm/book3s_hv.c
···48984898 BOOK3S_INTERRUPT_EXTERNAL, 0);48994899 else49004900 lpcr |= LPCR_MER;49014901+ } else {49024902+ /*49034903+ * L1's copy of L2's LPCR (vcpu->arch.vcore->lpcr) can get its MER bit49044904+ * unexpectedly set - for e.g. during NMI handling when all register49054905+ * states are synchronized from L0 to L1. L1 needs to inform L0 about49064906+ * MER=1 only when there are pending external interrupts.49074907+ * In the above if check, MER bit is set if there are pending49084908+ * external interrupts. Hence, explicity mask off MER bit49094909+ * here as otherwise it may generate spurious interrupts in L2 KVM49104910+ * causing an endless loop, which results in L2 guest getting hung.49114911+ */49124912+ lpcr &= ~LPCR_MER;49014913 }49024914 } else if (vcpu->arch.pending_exceptions ||49034915 vcpu->arch.doorbell_request ||
···671671 * )672672 */673673674674-#ifndef arch_init_invariance_cppc675675-static inline void arch_init_invariance_cppc(void) { }676676-#endif677677-678674/**679675 * acpi_cppc_processor_probe - Search for per CPU _CPC objects.680676 * @pr: Ptr to acpi_processor containing this CPU's logical ID.···900904 kobject_put(&cpc_ptr->kobj);901905 goto out_free;902906 }903903-904904- arch_init_invariance_cppc();905907906908 kfree(output.pointer);907909 return 0;
+9
drivers/acpi/processor_driver.c
···237237 .notifier_call = acpi_processor_notifier,238238};239239240240+void __weak acpi_processor_init_invariance_cppc(void)241241+{ }242242+240243/*241244 * We keep the driver loaded even when ACPI is not running.242245 * This is needed for the powernow-k8 driver, that works even without···273270 NULL, acpi_soft_cpu_dead);274271275272 acpi_processor_throttling_init();273273+274274+ /*275275+ * Frequency invariance calculations on AMD platforms can't be run until276276+ * after acpi_cppc_processor_probe() has been called for all online CPUs277277+ */278278+ acpi_processor_init_invariance_cppc();276279 return 0;277280err:278281 driver_unregister(&acpi_processor_driver);
···525525{526526 struct tpm_chip *chip = container_of(rng, struct tpm_chip, hwrng);527527528528- /* Give back zero bytes, as TPM chip has not yet fully resumed: */529529- if (chip->flags & TPM_CHIP_FLAG_SUSPENDED)530530- return 0;531531-532528 return tpm_get_random(chip, data, max);533529}534530
+22-10
drivers/char/tpm/tpm-interface.c
···370370 if (!chip)371371 return -ENODEV;372372373373+ rc = tpm_try_get_ops(chip);374374+ if (rc) {375375+ /* Can be safely set out of locks, as no action cannot race: */376376+ chip->flags |= TPM_CHIP_FLAG_SUSPENDED;377377+ goto out;378378+ }379379+373380 if (chip->flags & TPM_CHIP_FLAG_ALWAYS_POWERED)374381 goto suspended;375382···384377 !pm_suspend_via_firmware())385378 goto suspended;386379387387- rc = tpm_try_get_ops(chip);388388- if (!rc) {389389- if (chip->flags & TPM_CHIP_FLAG_TPM2) {390390- tpm2_end_auth_session(chip);391391- tpm2_shutdown(chip, TPM2_SU_STATE);392392- } else {393393- rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);394394- }395395-396396- tpm_put_ops(chip);380380+ if (chip->flags & TPM_CHIP_FLAG_TPM2) {381381+ tpm2_end_auth_session(chip);382382+ tpm2_shutdown(chip, TPM2_SU_STATE);383383+ goto suspended;397384 }385385+386386+ rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);398387399388suspended:400389 chip->flags |= TPM_CHIP_FLAG_SUSPENDED;390390+ tpm_put_ops(chip);401391392392+out:402393 if (rc)403394 dev_err(dev, "Ignoring error %d while suspending\n", rc);404395 return 0;···445440 if (!chip)446441 return -ENODEV;447442443443+ /* Give back zero bytes, as TPM chip has not yet fully resumed: */444444+ if (chip->flags & TPM_CHIP_FLAG_SUSPENDED) {445445+ rc = 0;446446+ goto out;447447+ }448448+448449 if (chip->flags & TPM_CHIP_FLAG_TPM2)449450 rc = tpm2_get_random(chip, out, max);450451 else451452 rc = tpm1_get_random(chip, out, max);452453454454+out:453455 tpm_put_ops(chip);454456 return rc;455457}
···10341034 hybrid_update_cpu_capacity_scaling();10351035}1036103610371037-static void hybrid_init_cpu_capacity_scaling(void)10371037+static void hybrid_init_cpu_capacity_scaling(bool refresh)10381038{10391039 bool disable_itmt = false;10401040···10451045 * scaling has been enabled already and the driver is just changing the10461046 * operation mode.10471047 */10481048- if (hybrid_max_perf_cpu) {10481048+ if (refresh) {10491049 __hybrid_init_cpu_capacity_scaling();10501050 goto unlock;10511051 }···10691069 */10701070 if (disable_itmt)10711071 sched_clear_itmt_support();10721072+}10731073+10741074+static bool hybrid_clear_max_perf_cpu(void)10751075+{10761076+ bool ret;10771077+10781078+ guard(mutex)(&hybrid_capacity_lock);10791079+10801080+ ret = !!hybrid_max_perf_cpu;10811081+ hybrid_max_perf_cpu = NULL;10821082+10831083+ return ret;10721084}1073108510741086static void __intel_pstate_get_hwp_cap(struct cpudata *cpu)···22752263 } else {22762264 cpu->pstate.scaling = perf_ctl_scaling;22772265 }22662266+ /*22672267+ * If the CPU is going online for the first time and it was22682268+ * offline initially, asym capacity scaling needs to be updated.22692269+ */22702270+ hybrid_update_capacity(cpu);22782271 } else {22792272 cpu->pstate.scaling = perf_ctl_scaling;22802273 cpu->pstate.max_pstate = pstate_funcs.get_max(cpu->cpu);···3369335233703353static int intel_pstate_register_driver(struct cpufreq_driver *driver)33713354{33553355+ bool refresh_cpu_cap_scaling;33723356 int ret;3373335733743358 if (driver == &intel_pstate)···3382336433833365 arch_set_max_freq_ratio(global.turbo_disabled);3384336633673367+ refresh_cpu_cap_scaling = hybrid_clear_max_perf_cpu();33683368+33853369 intel_pstate_driver = driver;33863370 ret = cpufreq_register_driver(intel_pstate_driver);33873371 if (ret) {···3393337333943374 global.min_perf_pct = min_perf_pct_min();3395337533963396- hybrid_init_cpu_capacity_scaling();33763376+ hybrid_init_cpu_capacity_scaling(refresh_cpu_cap_scaling);3397337733983378 return 0;33993379}
+5-3
drivers/edac/qcom_edac.c
···342342 int ecc_irq;343343 int rc;344344345345- rc = qcom_llcc_core_setup(llcc_driv_data, llcc_driv_data->bcast_regmap);346346- if (rc)347347- return rc;345345+ if (!llcc_driv_data->ecc_irq_configured) {346346+ rc = qcom_llcc_core_setup(llcc_driv_data, llcc_driv_data->bcast_regmap);347347+ if (rc)348348+ return rc;349349+ }348350349351 /* Allocate edac control info */350352 edev_ctl = edac_device_alloc_ctl_info(0, "qcom-llcc", 1, "bank",
···163163 * used to initialize this channel164164 * @dev: Reference to device in the SCMI hierarchy corresponding to this165165 * channel166166+ * @is_p2a: A flag to identify a channel as P2A (RX)166167 * @rx_timeout_ms: The configured RX timeout in milliseconds.167168 * @handle: Pointer to SCMI entity handle168169 * @no_completion_irq: Flag to indicate that this channel has no completion···175174struct scmi_chan_info {176175 int id;177176 struct device *dev;177177+ bool is_p2a;178178 unsigned int rx_timeout_ms;179179 struct scmi_handle *handle;180180 bool no_completion_irq;
+8-2
drivers/firmware/arm_scmi/driver.c
···10481048static inline void scmi_clear_channel(struct scmi_info *info,10491049 struct scmi_chan_info *cinfo)10501050{10511051+ if (!cinfo->is_p2a) {10521052+ dev_warn(cinfo->dev, "Invalid clear on A2P channel !\n");10531053+ return;10541054+ }10551055+10511056 if (info->desc->ops->clear_channel)10521057 info->desc->ops->clear_channel(cinfo);10531058}···26432638 if (!cinfo)26442639 return -ENOMEM;2645264026412641+ cinfo->is_p2a = !tx;26462642 cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms;2647264326482644 /* Create a unique name for this transport device */···3048304230493043 dev_info(dev, "Using %s\n", dev_driver_string(trans->supplier));3050304430513051- ret = of_property_read_u32(dev->of_node, "max-rx-timeout-ms",30453045+ ret = of_property_read_u32(dev->of_node, "arm,max-rx-timeout-ms",30523046 &trans->desc->max_rx_timeout_ms);30533047 if (ret && ret != -EINVAL)30543054- dev_err(dev, "Malformed max-rx-timeout-ms DT property.\n");30483048+ dev_err(dev, "Malformed arm,max-rx-timeout-ms DT property.\n");3055304930563050 dev_info(dev, "SCMI max-rx-timeout: %dms\n",30573051 trans->desc->max_rx_timeout_ms);
+7-35
drivers/firmware/microchip/mpfs-auto-update.c
···7676#define AUTO_UPDATE_INFO_SIZE SZ_1M7777#define AUTO_UPDATE_BITSTREAM_BASE (AUTO_UPDATE_DIRECTORY_SIZE + AUTO_UPDATE_INFO_SIZE)78787979-#define AUTO_UPDATE_TIMEOUT_MS 600008080-8179struct mpfs_auto_update_priv {8280 struct mpfs_sys_controller *sys_controller;8381 struct device *dev;8482 struct mtd_info *flash;8583 struct fw_upload *fw_uploader;8686- struct completion programming_complete;8784 size_t size_per_bitstream;8885 bool cancel_request;8986};···153156154157static enum fw_upload_err mpfs_auto_update_poll_complete(struct fw_upload *fw_uploader)155158{156156- struct mpfs_auto_update_priv *priv = fw_uploader->dd_handle;157157- int ret;158158-159159- /*160160- * There is no meaningful way to get the status of the programming while161161- * it is in progress, so attempting anything other than waiting for it162162- * to complete would be misplaced.163163- */164164- ret = wait_for_completion_timeout(&priv->programming_complete,165165- msecs_to_jiffies(AUTO_UPDATE_TIMEOUT_MS));166166- if (!ret)167167- return FW_UPLOAD_ERR_TIMEOUT;168168-169159 return FW_UPLOAD_ERR_NONE;170160}171161···333349 u32 offset, u32 size, u32 *written)334350{335351 struct mpfs_auto_update_priv *priv = fw_uploader->dd_handle;336336- enum fw_upload_err err = FW_UPLOAD_ERR_NONE;337352 int ret;338353339339- reinit_completion(&priv->programming_complete);340340-341354 ret = mpfs_auto_update_write_bitstream(fw_uploader, data, offset, size, written);342342- if (ret) {343343- err = FW_UPLOAD_ERR_RW_ERROR;344344- goto out;345345- }355355+ if (ret)356356+ return FW_UPLOAD_ERR_RW_ERROR;346357347347- if (priv->cancel_request) {348348- err = FW_UPLOAD_ERR_CANCELED;349349- goto out;350350- }358358+ if (priv->cancel_request)359359+ return FW_UPLOAD_ERR_CANCELED;351360352361 if (mpfs_auto_update_is_bitstream_info(data, size))353353- goto out;362362+ return FW_UPLOAD_ERR_NONE;354363355364 ret = mpfs_auto_update_verify_image(fw_uploader);356365 if (ret)357357- err = FW_UPLOAD_ERR_FW_INVALID;366366+ return FW_UPLOAD_ERR_FW_INVALID;358367359359-out:360360- complete(&priv->programming_complete);361361-362362- return err;368368+ return FW_UPLOAD_ERR_NONE;363369}364370365371static const struct fw_upload_ops mpfs_auto_update_ops = {···434460 if (ret)435461 return dev_err_probe(dev, ret,436462 "The current bitstream does not support auto-update\n");437437-438438- init_completion(&priv->programming_complete);439463440464 fw_uploader = firmware_upload_register(THIS_MODULE, dev, "mpfs-auto-update",441465 &mpfs_auto_update_ops, priv);
+14-3
drivers/firmware/qcom/qcom_scm.c
···112112};113113114114#define QSEECOM_MAX_APP_NAME_SIZE 64115115+#define SHMBRIDGE_RESULT_NOTSUPP 4115116116117/* Each bit configures cold/warm boot address for one of the 4 CPUs */117118static const u8 qcom_scm_cpu_cold_bits[QCOM_SCM_BOOT_MAX_CPUS] = {···217216218217struct qcom_tzmem_pool *qcom_scm_get_tzmem_pool(void)219218{220220- return __scm->mempool;219219+ return __scm ? __scm->mempool : NULL;221220}222221223222static enum qcom_scm_convention __get_convention(void)···546545 } else if (__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_BOOT,547546 QCOM_SCM_BOOT_SET_DLOAD_MODE)) {548547 ret = __qcom_scm_set_dload_mode(__scm->dev, !!dload_mode);549549- } else {548548+ } else if (dload_mode) {550549 dev_err(__scm->dev,551550 "No available mechanism for setting download mode\n");552551 }···1362136113631362int qcom_scm_shm_bridge_enable(void)13641363{13641364+ int ret;13651365+13651366 struct qcom_scm_desc desc = {13661367 .svc = QCOM_SCM_SVC_MP,13671368 .cmd = QCOM_SCM_MP_SHM_BRIDGE_ENABLE,···13761373 QCOM_SCM_MP_SHM_BRIDGE_ENABLE))13771374 return -EOPNOTSUPP;1378137513791379- return qcom_scm_call(__scm->dev, &desc, &res) ?: res.result[0];13761376+ ret = qcom_scm_call(__scm->dev, &desc, &res);13771377+13781378+ if (ret)13791379+ return ret;13801380+13811381+ if (res.result[0] == SHMBRIDGE_RESULT_NOTSUPP)13821382+ return -EOPNOTSUPP;13831383+13841384+ return res.result[0];13801385}13811386EXPORT_SYMBOL_GPL(qcom_scm_shm_bridge_enable);13821387
···172172 &buffer);173173 obj = (union acpi_object *)buffer.pointer;174174175175- /* Fail if calling the method fails and ATIF is supported */176176- if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {175175+ /* Fail if calling the method fails */176176+ if (ACPI_FAILURE(status)) {177177 DRM_DEBUG_DRIVER("failed to evaluate ATIF got %s\n",178178 acpi_format_exception(status));179179 kfree(obj);
···94299429 bool mode_set_reset_required = false;94309430 u32 i;94319431 struct dc_commit_streams_params params = {dc_state->streams, dc_state->stream_count};94329432+ bool set_backlight_level = false;9432943394339434 /* Disable writeback */94349435 for_each_old_connector_in_state(state, connector, old_con_state, i) {···95499548 acrtc->hw_mode = new_crtc_state->mode;95509549 crtc->hwmode = new_crtc_state->mode;95519550 mode_set_reset_required = true;95519551+ set_backlight_level = true;95529552 } else if (modereset_required(new_crtc_state)) {95539553 drm_dbg_atomic(dev,95549554 "Atomic commit: RESET. crtc id %d:[%p]\n",···95999597 dm_new_crtc_state->stream, acrtc);96009598 else96019599 acrtc->otg_inst = status->primary_otg_inst;96009600+ }96019601+ }96029602+96039603+ /* During boot up and resume the DC layer will reset the panel brightness96049604+ * to fix a flicker issue.96059605+ * It will cause the dm->actual_brightness is not the current panel brightness96069606+ * level. (the dm->brightness is the correct panel level)96079607+ * So we set the backlight level with dm->brightness value after set mode96089608+ */96099609+ if (set_backlight_level) {96109610+ for (i = 0; i < dm->num_of_edps; i++) {96119611+ if (dm->backlight_dev[i])96129612+ amdgpu_dm_backlight_set_level(dm, i, dm->brightness[i]);96029613 }96039614 }96049615}
···31273127 struct atom_data_revision revision;3128312831293129 // vram info moved to umc_info for DCN4x31303130- if (info && DATA_TABLES(umc_info)) {31303130+ if (dcb->ctx->dce_version >= DCN_VERSION_4_01 &&31313131+ dcb->ctx->dce_version < DCN_VERSION_MAX &&31323132+ info && DATA_TABLES(umc_info)) {31313133 header = GET_IMAGE(struct atom_common_table_header,31323134 DATA_TABLES(umc_info));31333135
···367367 return 0;368368}369369370370-#ifndef atom_smc_dpm_info_table_14_0_0371371-struct atom_smc_dpm_info_table_14_0_0 {372372- struct atom_common_table_header table_header;373373- BoardTable_t BoardTable;374374-};375375-#endif376376-377377-static int smu_v14_0_2_append_powerplay_table(struct smu_context *smu)378378-{379379- struct smu_table_context *table_context = &smu->smu_table;380380- PPTable_t *smc_pptable = table_context->driver_pptable;381381- struct atom_smc_dpm_info_table_14_0_0 *smc_dpm_table;382382- BoardTable_t *BoardTable = &smc_pptable->BoardTable;383383- int index, ret;384384-385385- index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,386386- smc_dpm_info);387387-388388- ret = amdgpu_atombios_get_data_table(smu->adev, index, NULL, NULL, NULL,389389- (uint8_t **)&smc_dpm_table);390390- if (ret)391391- return ret;392392-393393- memcpy(BoardTable, &smc_dpm_table->BoardTable, sizeof(BoardTable_t));394394-395395- return 0;396396-}397397-398398-#if 0399399-static int smu_v14_0_2_get_pptable_from_pmfw(struct smu_context *smu,400400- void **table,401401- uint32_t *size)402402-{403403- struct smu_table_context *smu_table = &smu->smu_table;404404- void *combo_pptable = smu_table->combo_pptable;405405- int ret = 0;406406-407407- ret = smu_cmn_get_combo_pptable(smu);408408- if (ret)409409- return ret;410410-411411- *table = combo_pptable;412412- *size = sizeof(struct smu_14_0_powerplay_table);413413-414414- return 0;415415-}416416-#endif417417-418370static int smu_v14_0_2_get_pptable_from_pmfw(struct smu_context *smu,419371 void **table,420372 uint32_t *size)···388436static int smu_v14_0_2_setup_pptable(struct smu_context *smu)389437{390438 struct smu_table_context *smu_table = &smu->smu_table;391391- struct amdgpu_device *adev = smu->adev;392439 int ret = 0;393440394441 if (amdgpu_sriov_vf(smu->adev))395442 return 0;396443397397- if (!adev->scpm_enabled)398398- ret = smu_v14_0_setup_pptable(smu);399399- else400400- ret = smu_v14_0_2_get_pptable_from_pmfw(smu,444444+ ret = smu_v14_0_2_get_pptable_from_pmfw(smu,401445 &smu_table->power_play_table,402446 &smu_table->power_play_table_size);403447 if (ret)···402454 ret = smu_v14_0_2_store_powerplay_table(smu);403455 if (ret)404456 return ret;405405-406406- /*407407- * With SCPM enabled, the operation below will be handled408408- * by PSP. Driver involvment is unnecessary and useless.409409- */410410- if (!adev->scpm_enabled) {411411- ret = smu_v14_0_2_append_powerplay_table(smu);412412- if (ret)413413- return ret;414414- }415457416458 ret = smu_v14_0_2_check_powerplay_table(smu);417459 if (ret)···18071869 if (workload_type < 0)18081870 return -EINVAL;1809187118101810- ret = smu_cmn_send_smc_msg_with_param(smu,18111811- SMU_MSG_SetWorkloadMask,18121812- 1 << workload_type,18131813- NULL);18721872+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetWorkloadMask,18731873+ smu->workload_mask, NULL);18741874+18141875 if (!ret)18151815- smu->workload_mask = 1 << workload_type;18761876+ smu_cmn_assign_power_profile(smu);1816187718171878 return ret;18181879}···27362799 .check_fw_status = smu_v14_0_check_fw_status,27372800 .setup_pptable = smu_v14_0_2_setup_pptable,27382801 .check_fw_version = smu_v14_0_check_fw_version,27392739- .write_pptable = smu_cmn_write_pptable,27402802 .set_driver_table_location = smu_v14_0_set_driver_table_location,27412803 .system_features_control = smu_v14_0_system_features_control,27422804 .set_allowed_mask = smu_v14_0_set_allowed_mask,
+8
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
···11381138 return ret;11391139}1140114011411141+void smu_cmn_assign_power_profile(struct smu_context *smu)11421142+{11431143+ uint32_t index;11441144+ index = fls(smu->workload_mask);11451145+ index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;11461146+ smu->power_profile_mode = smu->workload_setting[index];11471147+}11481148+11411149bool smu_cmn_is_audio_func_enabled(struct amdgpu_device *adev)11421150{11431151 struct pci_dev *p = NULL;
+2
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h
···130130int smu_cmn_set_mp1_state(struct smu_context *smu,131131 enum pp_mp1_state mp1_state);132132133133+void smu_cmn_assign_power_profile(struct smu_context *smu);134134+133135/*134136 * Helper function to make sysfs_emit_at() happy. Align buf to135137 * the current page boundary and record the offset.
···178178struct xe_file *xe_file_get(struct xe_file *xef);179179void xe_file_put(struct xe_file *xef);180180181181+/*182182+ * Occasionally it is seen that the G2H worker starts running after a delay of more than183183+ * a second even after being queued and activated by the Linux workqueue subsystem. This184184+ * leads to G2H timeout error. The root cause of issue lies with scheduling latency of185185+ * Lunarlake Hybrid CPU. Issue disappears if we disable Lunarlake atom cores from BIOS186186+ * and this is beyond xe kmd.187187+ *188188+ * TODO: Drop this change once workqueue scheduling delay issue is fixed on LNL Hybrid CPU.189189+ */190190+#define LNL_FLUSH_WORKQUEUE(wq__) \191191+ flush_workqueue(wq__)192192+#define LNL_FLUSH_WORK(wrk__) \193193+ flush_work(wrk__)194194+181195#endif
-9
drivers/gpu/drm/xe/xe_device_types.h
···353353 struct workqueue_struct *wq;354354 } sriov;355355356356- /** @clients: drm clients info */357357- struct {358358- /** @clients.lock: Protects drm clients info */359359- spinlock_t lock;360360-361361- /** @clients.count: number of drm clients */362362- u64 count;363363- } clients;364364-365356 /** @usm: unified memory state */366357 struct {367358 /** @usm.asid: convert a ASID to VM */
+9-4
drivers/gpu/drm/xe/xe_exec.c
···132132 if (XE_IOCTL_DBG(xe, !q))133133 return -ENOENT;134134135135- if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM))136136- return -EINVAL;135135+ if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM)) {136136+ err = -EINVAL;137137+ goto err_exec_queue;138138+ }137139138140 if (XE_IOCTL_DBG(xe, args->num_batch_buffer &&139139- q->width != args->num_batch_buffer))140140- return -EINVAL;141141+ q->width != args->num_batch_buffer)) {142142+ err = -EINVAL;143143+ goto err_exec_queue;144144+ }141145142146 if (XE_IOCTL_DBG(xe, q->ops->reset_status(q))) {143147 err = -ECANCELED;···224220 fence = xe_sync_in_fence_get(syncs, num_syncs, q, vm);225221 if (IS_ERR(fence)) {226222 err = PTR_ERR(fence);223223+ xe_vm_unlock(vm);227224 goto err_unlock_list;228225 }229226 for (i = 0; i < num_syncs; i++)
+6
drivers/gpu/drm/xe/xe_exec_queue.c
···260260{261261 int i;262262263263+ /*264264+ * Before releasing our ref to lrc and xef, accumulate our run ticks265265+ */266266+ xe_exec_queue_update_run_ticks(q);267267+263268 for (i = 0; i < q->width; ++i)264269 xe_lrc_put(q->lrc[i]);270270+265271 __xe_exec_queue_free(q);266272}267273
+11-4
drivers/gpu/drm/xe/xe_gt_ccs_mode.c
···6868 }6969 }70707171+ /*7272+ * Mask bits need to be set for the register. Though only Xe2+7373+ * platforms require setting of mask bits, it won't harm for older7474+ * platforms as these bits are unused there.7575+ */7676+ mode |= CCS_MODE_CSLICE_0_3_MASK << 16;7177 xe_mmio_write32(gt, CCS_MODE, mode);72787379 xe_gt_dbg(gt, "CCS_MODE=%x config:%08x, num_engines:%d, num_slices:%d\n",···139133 }140134141135 /* CCS mode can only be updated when there are no drm clients */142142- spin_lock(&xe->clients.lock);143143- if (xe->clients.count) {144144- spin_unlock(&xe->clients.lock);136136+ mutex_lock(&xe->drm.filelist_mutex);137137+ if (!list_empty(&xe->drm.filelist)) {138138+ mutex_unlock(&xe->drm.filelist_mutex);139139+ xe_gt_dbg(gt, "Rejecting compute mode change as there are active drm clients\n");145140 return -EBUSY;146141 }147142···153146 xe_gt_reset_async(gt);154147 }155148156156- spin_unlock(&xe->clients.lock);149149+ mutex_unlock(&xe->drm.filelist_mutex);157150158151 return count;159152}
+3-1
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
···387387 * the xe_ggtt_clear() called by below xe_ggtt_remove_node().388388 */389389 xe_ggtt_node_remove(node, false);390390+ } else {391391+ xe_ggtt_node_fini(node);390392 }391393}392394···444442 config->ggtt_region = node;445443 return 0;446444err:447447- xe_ggtt_node_fini(node);445445+ pf_release_ggtt(tile, node);448446 return err;449447}450448
···897897898898 ret = wait_event_timeout(ct->g2h_fence_wq, g2h_fence.done, HZ);899899900900- /*901901- * Occasionally it is seen that the G2H worker starts running after a delay of more than902902- * a second even after being queued and activated by the Linux workqueue subsystem. This903903- * leads to G2H timeout error. The root cause of issue lies with scheduling latency of904904- * Lunarlake Hybrid CPU. Issue dissappears if we disable Lunarlake atom cores from BIOS905905- * and this is beyond xe kmd.906906- *907907- * TODO: Drop this change once workqueue scheduling delay issue is fixed on LNL Hybrid CPU.908908- */909900 if (!ret) {910910- flush_work(&ct->g2h_worker);901901+ LNL_FLUSH_WORK(&ct->g2h_worker);911902 if (g2h_fence.done) {912903 xe_gt_warn(gt, "G2H fence %u, action %04x, done\n",913904 g2h_fence.seqno, action[0]);
···6666 priv = i2c_mux_priv(muxc);67676868 priv->regmap = dev_get_regmap(mux_dev->parent, NULL);6969- if (IS_ERR(priv->regmap))7070- return dev_err_probe(mux_dev, PTR_ERR(priv->regmap),6969+ if (!priv->regmap)7070+ return dev_err_probe(mux_dev, -ENODEV,7171 "No parent i2c register map\n");72727373 platform_set_drvdata(pdev, muxc);
+7
drivers/irqchip/irq-gic-v3.c
···524524 }525525526526 gic_poke_irq(d, reg);527527+528528+ /*529529+ * Force read-back to guarantee that the active state has taken530530+ * effect, and won't race with a guest-driven deactivation.531531+ */532532+ if (reg == GICD_ISACTIVER)533533+ gic_peek_irq(d, reg);527534 return 0;528535}529536
+30-29
drivers/md/dm-cache-target.c
···19051905 * This function gets called on the error paths of the constructor, so we19061906 * have to cope with a partially initialised struct.19071907 */19081908-static void destroy(struct cache *cache)19081908+static void __destroy(struct cache *cache)19091909{19101910- unsigned int i;19111911-19121910 mempool_exit(&cache->migration_pool);1913191119141912 if (cache->prison)19151913 dm_bio_prison_destroy_v2(cache->prison);1916191419171917- cancel_delayed_work_sync(&cache->waker);19181915 if (cache->wq)19191916 destroy_workqueue(cache->wq);19201917···19391942 if (cache->policy)19401943 dm_cache_policy_destroy(cache->policy);1941194419451945+ bioset_exit(&cache->bs);19461946+19471947+ kfree(cache);19481948+}19491949+19501950+static void destroy(struct cache *cache)19511951+{19521952+ unsigned int i;19531953+19541954+ cancel_delayed_work_sync(&cache->waker);19551955+19421956 for (i = 0; i < cache->nr_ctr_args ; i++)19431957 kfree(cache->ctr_args[i]);19441958 kfree(cache->ctr_args);1945195919461946- bioset_exit(&cache->bs);19471947-19481948- kfree(cache);19601960+ __destroy(cache);19491961}1950196219511963static void cache_dtr(struct dm_target *ti)···20092003 sector_t cache_sectors;2010200420112005 struct dm_dev *origin_dev;20122012- sector_t origin_sectors;2013200620142007 uint32_t block_size;20152008···20892084static int parse_origin_dev(struct cache_args *ca, struct dm_arg_set *as,20902085 char **error)20912086{20872087+ sector_t origin_sectors;20922088 int r;2093208920942090 if (!at_least_one_arg(as, error))···21022096 return r;21032097 }2104209821052105- ca->origin_sectors = get_dev_size(ca->origin_dev);21062106- if (ca->ti->len > ca->origin_sectors) {20992099+ origin_sectors = get_dev_size(ca->origin_dev);21002100+ if (ca->ti->len > origin_sectors) {21072101 *error = "Device size larger than cached device";21082102 return -EINVAL;21092103 }···2413240724142408 ca->metadata_dev = ca->origin_dev = ca->cache_dev = NULL;2415240924162416- origin_blocks = cache->origin_sectors = ca->origin_sectors;24102410+ origin_blocks = cache->origin_sectors = ti->len;24172411 origin_blocks = block_div(origin_blocks, ca->block_size);24182412 cache->origin_blocks = to_oblock(origin_blocks);24192413···25672561 *result = cache;25682562 return 0;25692563bad:25702570- destroy(cache);25642564+ __destroy(cache);25712565 return r;25722566}25732567···2618261226192613 r = copy_ctr_args(cache, argc - 3, (const char **)argv + 3);26202614 if (r) {26212621- destroy(cache);26152615+ __destroy(cache);26222616 goto out;26232617 }26242618···29012895static bool can_resize(struct cache *cache, dm_cblock_t new_size)29022896{29032897 if (from_cblock(new_size) > from_cblock(cache->cache_size)) {29042904- if (cache->sized) {29052905- DMERR("%s: unable to extend cache due to missing cache table reload",29062906- cache_device_name(cache));29072907- return false;29082908- }28982898+ DMERR("%s: unable to extend cache due to missing cache table reload",28992899+ cache_device_name(cache));29002900+ return false;29092901 }2910290229112903 /*29122904 * We can't drop a dirty block when shrinking the cache.29132905 */29142914- while (from_cblock(new_size) < from_cblock(cache->cache_size)) {29152915- new_size = to_cblock(from_cblock(new_size) + 1);29162916- if (is_dirty(cache, new_size)) {29062906+ if (cache->loaded_mappings) {29072907+ new_size = to_cblock(find_next_bit(cache->dirty_bitset,29082908+ from_cblock(cache->cache_size),29092909+ from_cblock(new_size)));29102910+ if (new_size != cache->cache_size) {29172911 DMERR("%s: unable to shrink cache; cache block %llu is dirty",29182912 cache_device_name(cache),29192913 (unsigned long long) from_cblock(new_size));···29492943 /*29502944 * Check to see if the cache has resized.29512945 */29522952- if (!cache->sized) {29532953- r = resize_cache_dev(cache, csize);29542954- if (r)29552955- return r;29562956-29572957- cache->sized = true;29582958-29592959- } else if (csize != cache->cache_size) {29462946+ if (!cache->sized || csize != cache->cache_size) {29602947 if (!can_resize(cache, csize))29612948 return -EINVAL;2962294929632950 r = resize_cache_dev(cache, csize);29642951 if (r)29652952 return r;29532953+29542954+ cache->sized = true;29662955 }2967295629682957 if (!cache->loaded_mappings) {
···17951795 unsigned p;17961796 unsigned x;1797179717981798+ if (WARN_ON_ONCE(!tpg->src_width || !tpg->scaled_width))17991799+ return;18001800+17981801 switch (tpg->pattern) {17991802 case TPG_PAT_GREEN:18001803 contrast = TPG_COLOR_100_RED;
+15-13
drivers/media/common/videobuf2/videobuf2-core.c
···14821482 }14831483 vb->planes[plane].dbuf_mapped = 1;14841484 }14851485+ } else {14861486+ for (plane = 0; plane < vb->num_planes; ++plane)14871487+ dma_buf_put(planes[plane].dbuf);14881488+ }1485148914861486- /*14871487- * Now that everything is in order, copy relevant information14881488- * provided by userspace.14891489- */14901490- for (plane = 0; plane < vb->num_planes; ++plane) {14911491- vb->planes[plane].bytesused = planes[plane].bytesused;14921492- vb->planes[plane].length = planes[plane].length;14931493- vb->planes[plane].m.fd = planes[plane].m.fd;14941494- vb->planes[plane].data_offset = planes[plane].data_offset;14951495- }14901490+ /*14911491+ * Now that everything is in order, copy relevant information14921492+ * provided by userspace.14931493+ */14941494+ for (plane = 0; plane < vb->num_planes; ++plane) {14951495+ vb->planes[plane].bytesused = planes[plane].bytesused;14961496+ vb->planes[plane].length = planes[plane].length;14971497+ vb->planes[plane].m.fd = planes[plane].m.fd;14981498+ vb->planes[plane].data_offset = planes[plane].data_offset;14991499+ }1496150015011501+ if (reacquired) {14971502 /*14981503 * Call driver-specific initialization on the newly acquired buffer,14991504 * if provided.···15081503 dprintk(q, 1, "buffer initialization failed\n");15091504 goto err_put_vb2_buf;15101505 }15111511- } else {15121512- for (plane = 0; plane < vb->num_planes; ++plane)15131513- dma_buf_put(planes[plane].dbuf);15141506 }1515150715161508 ret = call_vb_qop(vb, buf_prepare, vb);
+2-2
drivers/media/dvb-core/dvb_frontend.c
···443443444444 default:445445 fepriv->auto_step++;446446- fepriv->auto_sub_step = -1; /* it'll be incremented to 0 in a moment */447447- break;446446+ fepriv->auto_sub_step = 0;447447+ continue;448448 }449449450450 if (!ready) fepriv->auto_sub_step++;
···775775 (unsigned long)vb2_plane_vaddr(&vb->vb2_buf, 0) + ctx->out_q.sos + 2;776776 jpeg_buffer.curr = 0;777777778778- word = 0;779779-780778 if (get_word_be(&jpeg_buffer, &word))781779 return;782782- jpeg_buffer.size = (long)word - 2;780780+781781+ if (word < 2)782782+ jpeg_buffer.size = 0;783783+ else784784+ jpeg_buffer.size = (long)word - 2;785785+783786 jpeg_buffer.data += 2;784787 jpeg_buffer.curr = 0;785788···10611058 if (byte == -1)10621059 return -1;10631060 *word = (unsigned int)byte | temp;10611061+10641062 return 0;10651063}10661064···11491145 if (get_word_be(&jpeg_buffer, &word))11501146 break;11511147 length = (long)word - 2;11521152- if (!length)11481148+ if (length <= 0)11531149 return false;11541150 sof = jpeg_buffer.curr; /* after 0xffc0 */11551151 sof_len = length;···11801176 if (get_word_be(&jpeg_buffer, &word))11811177 break;11821178 length = (long)word - 2;11831183- if (!length)11791179+ if (length <= 0)11841180 return false;11851181 if (n_dqt >= S5P_JPEG_MAX_MARKER)11861182 return false;···11931189 if (get_word_be(&jpeg_buffer, &word))11941190 break;11951191 length = (long)word - 2;11961196- if (!length)11921192+ if (length <= 0)11971193 return false;11981194 if (n_dht >= S5P_JPEG_MAX_MARKER)11991195 return false;···12181214 if (get_word_be(&jpeg_buffer, &word))12191215 break;12201216 length = (long)word - 2;12171217+ /* No need to check underflows as skip() does it */12211218 skip(&jpeg_buffer, length);12221219 break;12231220 }
+1-1
drivers/media/test-drivers/vivid/vivid-core.c
···910910 * videobuf2-core.c to MAX_BUFFER_INDEX.911911 */912912 if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE)913913- q->max_num_buffers = 64;913913+ q->max_num_buffers = MAX_VID_CAP_BUFFERS;914914 if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE)915915 q->max_num_buffers = 1024;916916 if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE)
+3-1
drivers/media/test-drivers/vivid/vivid-core.h
···2626#define MAX_INPUTS 162727/* The maximum number of outputs */2828#define MAX_OUTPUTS 162929+/* The maximum number of video capture buffers */3030+#define MAX_VID_CAP_BUFFERS 642931/* The maximum up or down scaling factor is 4 */3032#define MAX_ZOOM 43133/* The maximum image width/height are set to 4K DMT */···483481 /* video capture */484482 struct tpg_data tpg;485483 unsigned ms_vid_cap;486486- bool must_blank[VIDEO_MAX_FRAME];484484+ bool must_blank[MAX_VID_CAP_BUFFERS];487485488486 const struct vivid_fmt *fmt_cap;489487 struct v4l2_fract timeperframe_vid_cap;
+1-1
drivers/media/test-drivers/vivid/vivid-ctrls.c
···553553 break;554554 case VIVID_CID_PERCENTAGE_FILL:555555 tpg_s_perc_fill(&dev->tpg, ctrl->val);556556- for (i = 0; i < VIDEO_MAX_FRAME; i++)556556+ for (i = 0; i < MAX_VID_CAP_BUFFERS; i++)557557 dev->must_blank[i] = ctrl->val < 100;558558 break;559559 case VIVID_CID_INSERT_SAV:
+1-1
drivers/media/test-drivers/vivid/vivid-vid-cap.c
···213213214214 dev->vid_cap_seq_count = 0;215215 dprintk(dev, 1, "%s\n", __func__);216216- for (i = 0; i < VIDEO_MAX_FRAME; i++)216216+ for (i = 0; i < MAX_VID_CAP_BUFFERS; i++)217217 dev->must_blank[i] = tpg_g_perc_fill(&dev->tpg) < 100;218218 if (dev->start_streaming_error) {219219 dev->start_streaming_error = false;
+11-6
drivers/media/v4l2-core/v4l2-ctrls-api.c
···753753 for (i = 0; i < master->ncontrols; i++)754754 cur_to_new(master->cluster[i]);755755 ret = call_op(master, g_volatile_ctrl);756756- new_to_user(c, ctrl);756756+ if (!ret)757757+ ret = new_to_user(c, ctrl);757758 } else {758758- cur_to_user(c, ctrl);759759+ ret = cur_to_user(c, ctrl);759760 }760761 v4l2_ctrl_unlock(master);761762 return ret;···771770 if (!ctrl || !ctrl->is_int)772771 return -EINVAL;773772 ret = get_ctrl(ctrl, &c);774774- control->value = c.value;773773+774774+ if (!ret)775775+ control->value = c.value;776776+775777 return ret;776778}777779EXPORT_SYMBOL(v4l2_g_ctrl);···815811 int ret;816812817813 v4l2_ctrl_lock(ctrl);818818- user_to_new(c, ctrl);819819- ret = set_ctrl(fh, ctrl, 0);814814+ ret = user_to_new(c, ctrl);820815 if (!ret)821821- cur_to_user(c, ctrl);816816+ ret = set_ctrl(fh, ctrl, 0);817817+ if (!ret)818818+ ret = cur_to_user(c, ctrl);822819 v4l2_ctrl_unlock(ctrl);823820 return ret;824821}
···1011101110121012 /* common for all type of bus errors */10131013 priv->can.can_stats.bus_error++;10141014- stats->rx_errors++;1015101410161015 /* propagate the error condition to the CAN stack */10171016 skb = alloc_can_err_skb(dev, &cf);···10261027 case LEC_STUFF_ERROR:10271028 netdev_dbg(dev, "stuff error\n");10281029 cf->data[2] |= CAN_ERR_PROT_STUFF;10301030+ stats->rx_errors++;10291031 break;10301032 case LEC_FORM_ERROR:10311033 netdev_dbg(dev, "form error\n");10321034 cf->data[2] |= CAN_ERR_PROT_FORM;10351035+ stats->rx_errors++;10331036 break;10341037 case LEC_ACK_ERROR:10351038 netdev_dbg(dev, "ack error\n");10361039 cf->data[3] = CAN_ERR_PROT_LOC_ACK;10401040+ stats->tx_errors++;10371041 break;10381042 case LEC_BIT1_ERROR:10391043 netdev_dbg(dev, "bit1 error\n");10401044 cf->data[2] |= CAN_ERR_PROT_BIT1;10451045+ stats->tx_errors++;10411046 break;10421047 case LEC_BIT0_ERROR:10431048 netdev_dbg(dev, "bit0 error\n");10441049 cf->data[2] |= CAN_ERR_PROT_BIT0;10501050+ stats->tx_errors++;10451051 break;10461052 case LEC_CRC_ERROR:10471053 netdev_dbg(dev, "CRC error\n");10481054 cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;10551055+ stats->rx_errors++;10491056 break;10501057 default:10511058 break;
+1-1
drivers/net/can/cc770/Kconfig
···7788config CAN_CC770_ISA99 tristate "ISA Bus based legacy CC770 driver"1010- depends on ISA1010+ depends on HAS_IOPORT1111 help1212 This driver adds legacy support for CC770 and AN82527 chips1313 connected to the ISA bus using I/O port, memory mapped or
···2233config CAN_ROCKCHIP_CANFD44 tristate "Rockchip CAN-FD controller"55- depends on OF || COMPILE_TEST55+ depends on OF66+ depends on ARCH_ROCKCHIP || COMPILE_TEST67 select CAN_RX_OFFLOAD78 help89 Say Y here if you want to use CAN-FD controller found on
+1-1
drivers/net/can/sja1000/Kconfig
···87878888config CAN_SJA1000_ISA8989 tristate "ISA Bus based legacy SJA1000 driver"9090- depends on ISA9090+ depends on HAS_IOPORT9191 help9292 This driver adds legacy support for SJA1000 chips connected to9393 the ISA bus using I/O port, memory mapped or indirect access.
···16161717#include "mcp251xfd.h"18181919-static inline bool mcp251xfd_tx_fifo_sta_full(u32 fifo_sta)1919+static inline bool mcp251xfd_tx_fifo_sta_empty(u32 fifo_sta)2020{2121- return !(fifo_sta & MCP251XFD_REG_FIFOSTA_TFNRFNIF);2121+ return fifo_sta & MCP251XFD_REG_FIFOSTA_TFERFFIF;2222}23232424static inline int···122122 if (err)123123 return err;124124125125- if (mcp251xfd_tx_fifo_sta_full(fifo_sta)) {125125+ /* If the chip says the TX-FIFO is empty, but there are no TX126126+ * buffers free in the ring, we assume all have been sent.127127+ */128128+ if (mcp251xfd_tx_fifo_sta_empty(fifo_sta) &&129129+ mcp251xfd_get_tx_free(tx_ring) == 0) {126130 *len_p = tx_ring->obj_num;127131 return 0;128132 }
+16-11
drivers/net/ethernet/arc/emac_main.c
···111111{112112 struct arc_emac_priv *priv = netdev_priv(ndev);113113 struct net_device_stats *stats = &ndev->stats;114114+ struct device *dev = ndev->dev.parent;114115 unsigned int i;115116116117 for (i = 0; i < TX_BD_NUM; i++) {···141140 stats->tx_bytes += skb->len;142141 }143142144144- dma_unmap_single(&ndev->dev, dma_unmap_addr(tx_buff, addr),143143+ dma_unmap_single(dev, dma_unmap_addr(tx_buff, addr),145144 dma_unmap_len(tx_buff, len), DMA_TO_DEVICE);146145147146 /* return the sk_buff to system */···175174static int arc_emac_rx(struct net_device *ndev, int budget)176175{177176 struct arc_emac_priv *priv = netdev_priv(ndev);177177+ struct device *dev = ndev->dev.parent;178178 unsigned int work_done;179179180180 for (work_done = 0; work_done < budget; work_done++) {···225223 continue;226224 }227225228228- addr = dma_map_single(&ndev->dev, (void *)skb->data,226226+ addr = dma_map_single(dev, (void *)skb->data,229227 EMAC_BUFFER_SIZE, DMA_FROM_DEVICE);230230- if (dma_mapping_error(&ndev->dev, addr)) {228228+ if (dma_mapping_error(dev, addr)) {231229 if (net_ratelimit())232230 netdev_err(ndev, "cannot map dma buffer\n");233231 dev_kfree_skb(skb);···239237 }240238241239 /* unmap previosly mapped skb */242242- dma_unmap_single(&ndev->dev, dma_unmap_addr(rx_buff, addr),240240+ dma_unmap_single(dev, dma_unmap_addr(rx_buff, addr),243241 dma_unmap_len(rx_buff, len), DMA_FROM_DEVICE);244242245243 pktlen = info & LEN_MASK;···425423{426424 struct arc_emac_priv *priv = netdev_priv(ndev);427425 struct phy_device *phy_dev = ndev->phydev;426426+ struct device *dev = ndev->dev.parent;428427 int i;429428430429 phy_dev->autoneg = AUTONEG_ENABLE;···448445 if (unlikely(!rx_buff->skb))449446 return -ENOMEM;450447451451- addr = dma_map_single(&ndev->dev, (void *)rx_buff->skb->data,448448+ addr = dma_map_single(dev, (void *)rx_buff->skb->data,452449 EMAC_BUFFER_SIZE, DMA_FROM_DEVICE);453453- if (dma_mapping_error(&ndev->dev, addr)) {450450+ if (dma_mapping_error(dev, addr)) {454451 netdev_err(ndev, "cannot dma map\n");455452 dev_kfree_skb(rx_buff->skb);456453 return -ENOMEM;···551548static void arc_free_tx_queue(struct net_device *ndev)552549{553550 struct arc_emac_priv *priv = netdev_priv(ndev);551551+ struct device *dev = ndev->dev.parent;554552 unsigned int i;555553556554 for (i = 0; i < TX_BD_NUM; i++) {···559555 struct buffer_state *tx_buff = &priv->tx_buff[i];560556561557 if (tx_buff->skb) {562562- dma_unmap_single(&ndev->dev,558558+ dma_unmap_single(dev,563559 dma_unmap_addr(tx_buff, addr),564560 dma_unmap_len(tx_buff, len),565561 DMA_TO_DEVICE);···583579static void arc_free_rx_queue(struct net_device *ndev)584580{585581 struct arc_emac_priv *priv = netdev_priv(ndev);582582+ struct device *dev = ndev->dev.parent;586583 unsigned int i;587584588585 for (i = 0; i < RX_BD_NUM; i++) {···591586 struct buffer_state *rx_buff = &priv->rx_buff[i];592587593588 if (rx_buff->skb) {594594- dma_unmap_single(&ndev->dev,589589+ dma_unmap_single(dev,595590 dma_unmap_addr(rx_buff, addr),596591 dma_unmap_len(rx_buff, len),597592 DMA_FROM_DEVICE);···684679 unsigned int len, *txbd_curr = &priv->txbd_curr;685680 struct net_device_stats *stats = &ndev->stats;686681 __le32 *info = &priv->txbd[*txbd_curr].info;682682+ struct device *dev = ndev->dev.parent;687683 dma_addr_t addr;688684689685 if (skb_padto(skb, ETH_ZLEN))···698692 return NETDEV_TX_BUSY;699693 }700694701701- addr = dma_map_single(&ndev->dev, (void *)skb->data, len,702702- DMA_TO_DEVICE);695695+ addr = dma_map_single(dev, (void *)skb->data, len, DMA_TO_DEVICE);703696704704- if (unlikely(dma_mapping_error(&ndev->dev, addr))) {697697+ if (unlikely(dma_mapping_error(dev, addr))) {705698 stats->tx_dropped++;706699 stats->tx_errors++;707700 dev_kfree_skb_any(skb);
···1293129312941294 /* save the buffer addr until the last read operation */12951295 *save_buf = read_buf;12961296- }1297129612981298- /* get data ready for the first time to read */12991299- if (!*ppos) {12971297+ /* get data ready for the first time to read */13001298 ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd,13011299 read_buf, hns3_dbg_cmd[index].buf_len);13021300 if (ret)
···19331933 return ret;19341934}1935193519361936-static int hns3_check_tx_copybreak(struct net_device *netdev, u32 copybreak)19371937-{19381938- struct hns3_nic_priv *priv = netdev_priv(netdev);19391939-19401940- if (copybreak < priv->min_tx_copybreak) {19411941- netdev_err(netdev, "tx copybreak %u should be no less than %u!\n",19421942- copybreak, priv->min_tx_copybreak);19431943- return -EINVAL;19441944- }19451945- return 0;19461946-}19471947-19481948-static int hns3_check_tx_spare_buf_size(struct net_device *netdev, u32 buf_size)19491949-{19501950- struct hns3_nic_priv *priv = netdev_priv(netdev);19511951-19521952- if (buf_size < priv->min_tx_spare_buf_size) {19531953- netdev_err(netdev,19541954- "tx spare buf size %u should be no less than %u!\n",19551955- buf_size, priv->min_tx_spare_buf_size);19561956- return -EINVAL;19571957- }19581958- return 0;19591959-}19601960-19611936static int hns3_set_tunable(struct net_device *netdev,19621937 const struct ethtool_tunable *tuna,19631938 const void *data)···1949197419501975 switch (tuna->id) {19511976 case ETHTOOL_TX_COPYBREAK:19521952- ret = hns3_check_tx_copybreak(netdev, *(u32 *)data);19531953- if (ret)19541954- return ret;19551955-19561977 priv->tx_copybreak = *(u32 *)data;1957197819581979 for (i = 0; i < h->kinfo.num_tqps; i++)···1963199219641993 break;19651994 case ETHTOOL_TX_COPYBREAK_BUF_SIZE:19661966- ret = hns3_check_tx_spare_buf_size(netdev, *(u32 *)data);19671967- if (ret)19681968- return ret;19691969-19701995 old_tx_spare_buf_size = h->kinfo.tx_spare_buf_size;19711996 new_tx_spare_buf_size = *(u32 *)data;19721997 netdev_info(netdev, "request to set tx spare buf size from %u to %u\n",
···12051205 if (ret_val)12061206 goto out;1207120712081208- if (hw->mac.type != e1000_pch_mtp) {12091209- ret_val = e1000e_force_smbus(hw);12101210- if (ret_val) {12111211- e_dbg("Failed to force SMBUS: %d\n", ret_val);12121212- goto release;12131213- }12081208+ ret_val = e1000e_force_smbus(hw);12091209+ if (ret_val) {12101210+ e_dbg("Failed to force SMBUS: %d\n", ret_val);12111211+ goto release;12141212 }1215121312161214 /* Si workaround for ULP entry flow on i127/rev6 h/w. Enable···12711273 }1272127412731275release:12741274- if (hw->mac.type == e1000_pch_mtp) {12751275- ret_val = e1000e_force_smbus(hw);12761276- if (ret_val)12771277- e_dbg("Failed to force SMBUS over MTL system: %d\n",12781278- ret_val);12791279- }12801280-12811276 hw->phy.ops.release(hw);12821277out:12831278 if (ret_val)
+1
drivers/net/ethernet/intel/i40e/i40e.h
···755755 I40E_FILTER_ACTIVE, /* Added to switch by FW */756756 I40E_FILTER_FAILED, /* Rejected by FW */757757 I40E_FILTER_REMOVE, /* To be removed */758758+ I40E_FILTER_NEW_SYNC, /* New, not sent yet, is in i40e_sync_vsi_filters() */758759/* There is no 'removed' state; the filter struct is freed */759760};760761struct i40e_mac_filter {
···17861786 */17871787 err = idpf_vc_core_init(adapter);17881788 if (err) {17891789+ cancel_delayed_work_sync(&adapter->mbx_task);17891790 idpf_deinit_dflt_mbx(adapter);17901791 goto unlock_mutex;17911792 }···18611860 * mess with. Nothing below should use those variables from new_vport18621861 * and should instead always refer to them in vport if they need to.18631862 */18641864- memcpy(new_vport, vport, offsetof(struct idpf_vport, link_speed_mbps));18631863+ memcpy(new_vport, vport, offsetof(struct idpf_vport, link_up));1865186418661865 /* Adjust resource parameters prior to reallocating resources */18671866 switch (reset_cause) {···19071906 /* Same comment as above regarding avoiding copying the wait_queues and19081907 * mutexes applies here. We do not want to mess with those if possible.19091908 */19101910- memcpy(vport, new_vport, offsetof(struct idpf_vport, link_speed_mbps));19091909+ memcpy(vport, new_vport, offsetof(struct idpf_vport, link_up));1911191019121911 if (reset_cause == IDPF_SR_Q_CHANGE)19131912 idpf_vport_alloc_vec_indexes(vport);
···37803780 /* Request the Wake IRQ in case of another line37813781 * is used for WoL37823782 */37833783+ priv->wol_irq_disabled = true;37833784 if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) {37843785 ret = request_irq(priv->wol_irq, stmmac_interrupt,37853786 IRQF_SHARED, dev->name, dev);
···44 * Copyright (c) 2022, Linaro Ltd55 */66#include <linux/auxiliary_bus.h>77+#include <linux/delay.h>78#include <linux/module.h>89#include <linux/of.h>910#include <linux/platform_device.h>···1312#include <linux/soc/qcom/pdr.h>1413#include <linux/soc/qcom/pmic_glink.h>1514#include <linux/spinlock.h>1515+1616+#define PMIC_GLINK_SEND_TIMEOUT (5 * HZ)16171718enum {1819 PMIC_GLINK_CLIENT_BATT = 0,···115112int pmic_glink_send(struct pmic_glink_client *client, void *data, size_t len)116113{117114 struct pmic_glink *pg = client->pg;115115+ bool timeout_reached = false;116116+ unsigned long start;118117 int ret;119118120119 mutex_lock(&pg->state_lock);121121- if (!pg->ept)120120+ if (!pg->ept) {122121 ret = -ECONNRESET;123123- else124124- ret = rpmsg_send(pg->ept, data, len);122122+ } else {123123+ start = jiffies;124124+ for (;;) {125125+ ret = rpmsg_send(pg->ept, data, len);126126+ if (ret != -EAGAIN)127127+ break;128128+129129+ if (timeout_reached) {130130+ ret = -ETIMEDOUT;131131+ break;132132+ }133133+134134+ usleep_range(1000, 5000);135135+ timeout_reached = time_after(jiffies, start + PMIC_GLINK_SEND_TIMEOUT);136136+ }137137+ }125138 mutex_unlock(&pg->state_lock);126139127140 return ret;
+7-1
drivers/soc/qcom/socinfo.c
···786786 qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u",787787 SOCINFO_MAJOR(le32_to_cpu(info->ver)),788788 SOCINFO_MINOR(le32_to_cpu(info->ver)));789789- if (offsetof(struct socinfo, serial_num) <= item_size)789789+ if (!qs->attr.soc_id || !qs->attr.revision)790790+ return -ENOMEM;791791+792792+ if (offsetof(struct socinfo, serial_num) <= item_size) {790793 qs->attr.serial_number = devm_kasprintf(&pdev->dev, GFP_KERNEL,791794 "%u",792795 le32_to_cpu(info->serial_num));796796+ if (!qs->attr.serial_number)797797+ return -ENOMEM;798798+ }793799794800 qs->soc_dev = soc_device_register(&qs->attr);795801 if (IS_ERR(qs->soc_dev))
+3-1
drivers/staging/media/av7110/av7110.h
···8888 u32 ir_config;8989};90909191+#define MAX_CI_SLOTS 29292+9193/* place to store all the necessary device information */9294struct av7110 {9395 /* devices */···165163166164 /* CA */167165168168- struct ca_slot_info ci_slot[2];166166+ struct ca_slot_info ci_slot[MAX_CI_SLOTS];169167170168 enum av7110_video_mode vidmode;171169 struct dmxdev dmxdev;
···7373static int lmh_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)7474{7575 struct lmh_hw_data *lmh_data = d->host_data;7676+ static struct lock_class_key lmh_lock_key;7777+ static struct lock_class_key lmh_request_key;76787979+ /*8080+ * This lock class tells lockdep that GPIO irqs are in a different8181+ * category than their parents, so it won't report false recursion.8282+ */8383+ irq_set_lockdep_class(irq, &lmh_lock_key, &lmh_request_key);7784 irq_set_chip_and_handler(irq, &lmh_irq_chip, handle_simple_irq);7885 irq_set_chip_data(irq, lmh_data);7986
+10-11
drivers/thermal/thermal_of.c
···9999 struct device_node *trips;100100 int ret, count;101101102102+ *ntrips = 0;103103+102104 trips = of_get_child_by_name(np, "trips");103103- if (!trips) {104104- pr_err("Failed to find 'trips' node\n");105105- return ERR_PTR(-EINVAL);106106- }105105+ if (!trips)106106+ return NULL;107107108108 count = of_get_child_count(trips);109109- if (!count) {110110- pr_err("No trip point defined\n");111111- ret = -EINVAL;112112- goto out_of_node_put;113113- }109109+ if (!count)110110+ return NULL;114111115112 tt = kzalloc(sizeof(*tt) * count, GFP_KERNEL);116113 if (!tt) {···130133131134out_kfree:132135 kfree(tt);133133- *ntrips = 0;134136out_of_node_put:135137 of_node_put(trips);136138···397401398402 trips = thermal_of_trips_init(np, &ntrips);399403 if (IS_ERR(trips)) {400400- pr_err("Failed to find trip points for %pOFn id=%d\n", sensor, id);404404+ pr_err("Failed to parse trip points for %pOFn id=%d\n", sensor, id);401405 ret = PTR_ERR(trips);402406 goto out_of_node_put;403407 }408408+409409+ if (!trips)410410+ pr_info("No trip points found for %pOFn id=%d\n", sensor, id);404411405412 ret = thermal_of_monitor_init(np, &delay, &pdelay);406413 if (ret) {
+2
drivers/thunderbolt/retimer.c
···532532 }533533534534 ret = 0;535535+ if (!IS_ENABLED(CONFIG_USB4_DEBUGFS_MARGINING))536536+ max = min(last_idx, max);535537536538 /* Add retimers if they do not exist already */537539 for (i = 1; i <= max; i++) {
+1-1
drivers/thunderbolt/usb4.c
···48484949/* Delays in us used with usb4_port_wait_for_bit() */5050#define USB4_PORT_DELAY 505151-#define USB4_PORT_SB_DELAY 50005151+#define USB4_PORT_SB_DELAY 100052525353static int usb4_native_switch_op(struct tb_switch *sw, u16 opcode,5454 u32 *metadata, u8 *status,
+8-2
drivers/ufs/core/ufshcd.c
···86368636 ufshcd_init_clk_scaling_sysfs(hba);86378637 }8638863886398639+ /*86408640+ * The RTC update code accesses the hba->ufs_device_wlun->sdev_gendev86418641+ * pointer and hence must only be started after the WLUN pointer has86428642+ * been initialized by ufshcd_scsi_add_wlus().86438643+ */86448644+ schedule_delayed_work(&hba->ufs_rtc_update_work,86458645+ msecs_to_jiffies(UFS_RTC_UPDATE_INTERVAL_MS));86468646+86398647 ufs_bsg_probe(hba);86408648 scsi_scan_host(hba->host);86418649···88038795 ufshcd_force_reset_auto_bkops(hba);8804879688058797 ufshcd_set_timestamp_attr(hba);88068806- schedule_delayed_work(&hba->ufs_rtc_update_work,88078807- msecs_to_jiffies(UFS_RTC_UPDATE_INTERVAL_MS));8808879888098799 /* Gear up to HS gear if supported */88108800 if (hba->max_pwr_info.is_valid) {
+12-13
drivers/usb/dwc3/core.c
···23422342 u32 reg;23432343 int i;2344234423452345- dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) &23462346- DWC3_GUSB2PHYCFG_SUSPHY) ||23472347- (dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)) &23482348- DWC3_GUSB3PIPECTL_SUSPHY);23452345+ if (!pm_runtime_suspended(dwc->dev) && !PMSG_IS_AUTO(msg)) {23462346+ dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) &23472347+ DWC3_GUSB2PHYCFG_SUSPHY) ||23482348+ (dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)) &23492349+ DWC3_GUSB3PIPECTL_SUSPHY);23502350+ /*23512351+ * TI AM62 platform requires SUSPHY to be23522352+ * enabled for system suspend to work.23532353+ */23542354+ if (!dwc->susphy_state)23552355+ dwc3_enable_susphy(dwc, true);23562356+ }2349235723502358 switch (dwc->current_dr_role) {23512359 case DWC3_GCTL_PRTCAP_DEVICE:···24042396 default:24052397 /* do nothing */24062398 break;24072407- }24082408-24092409- if (!PMSG_IS_AUTO(msg)) {24102410- /*24112411- * TI AM62 platform requires SUSPHY to be24122412- * enabled for system suspend to work.24132413- */24142414- if (!dwc->susphy_state)24152415- dwc3_enable_susphy(dwc, true);24162399 }2417240024182401 return 0;
-2
drivers/usb/musb/sunxi.c
···293293 if (test_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags))294294 sunxi_sram_release(musb->controller->parent);295295296296- devm_usb_put_phy(glue->dev, glue->xceiv);297297-298296 return 0;299297}300298
+4-4
drivers/usb/serial/io_edgeport.c
···770770static void edge_bulk_out_cmd_callback(struct urb *urb)771771{772772 struct edgeport_port *edge_port = urb->context;773773+ struct device *dev = &urb->dev->dev;773774 int status = urb->status;774775775776 atomic_dec(&CmdUrbs);776776- dev_dbg(&urb->dev->dev, "%s - FREE URB %p (outstanding %d)\n",777777- __func__, urb, atomic_read(&CmdUrbs));777777+ dev_dbg(dev, "%s - FREE URB %p (outstanding %d)\n", __func__, urb,778778+ atomic_read(&CmdUrbs));778779779780780781 /* clean up the transfer buffer */···785784 usb_free_urb(urb);786785787786 if (status) {788788- dev_dbg(&urb->dev->dev,789789- "%s - nonzero write bulk status received: %d\n",787787+ dev_dbg(dev, "%s - nonzero write bulk status received: %d\n",790788 __func__, status);791789 return;792790 }
···862862 if (ret)863863 goto err;864864865865+ /*866866+ * Normally set by the appropriate recovery pass: when cleared, this867867+ * indicates we're in early recovery and btree updates should be done by868868+ * being applied to the journal replay keys. _Must_ be cleared before869869+ * multithreaded use:870870+ */871871+ set_bit(BCH_FS_may_go_rw, &c->flags);865872 clear_bit(BCH_FS_fsck_running, &c->flags);866873867874 /* in case we don't run journal replay, i.e. norecovery mode */
+6
fs/bcachefs/recovery_passes.c
···221221{222222 int ret = 0;223223224224+ /*225225+ * We can't allow set_may_go_rw to be excluded; that would cause us to226226+ * use the journal replay keys for updates where it's not expected.227227+ */228228+ c->opts.recovery_passes_exclude &= ~BCH_RECOVERY_PASS_set_may_go_rw;229229+224230 while (c->curr_recovery_pass < ARRAY_SIZE(recovery_pass_fns)) {225231 if (c->opts.recovery_pass_last &&226232 c->curr_recovery_pass > c->opts.recovery_pass_last)
+5
fs/bcachefs/tests.c
···809809 unsigned i;810810 u64 time;811811812812+ if (nr == 0 || nr_threads == 0) {813813+ pr_err("nr of iterations or threads is not allowed to be 0");814814+ return -EINVAL;815815+ }816816+812817 atomic_set(&j.ready, nr_threads);813818 init_waitqueue_head(&j.ready_wait);814819
···19791979 * fsconfig(FSCONFIG_SET_FLAG, "ro"). This option is seen by the filesystem19801980 * in fc->sb_flags.19811981 *19821982- * This disambiguation has rather positive consequences. Mounting a subvolume19831983- * ro will not also turn the superblock ro. Only the mount for the subvolume19841984- * will become ro.19851985- *19861986- * So, if the superblock creation request comes from the new mount API the19871987- * caller must have explicitly done:19881988- *19891989- * fsconfig(FSCONFIG_SET_FLAG, "ro")19901990- * fsmount/mount_setattr(MOUNT_ATTR_RDONLY)19911991- *19921992- * IOW, at some point the caller must have explicitly turned the whole19931993- * superblock ro and we shouldn't just undo it like we did for the old mount19941994- * API. In any case, it lets us avoid the hack in the new mount API.19951995- *19961996- * Consequently, the remounting hack must only be used for requests originating19971997- * from the old mount API and should be marked for full deprecation so it can be19981998- * turned off in a couple of years.19991999- *20002000- * The new mount API has no reason to support this hack.19821982+ * But, currently the util-linux mount command already utilizes the new mount19831983+ * API and is still setting fsconfig(FSCONFIG_SET_FLAG, "ro") no matter if it's19841984+ * btrfs or not, setting the whole super block RO. To make per-subvolume mounting19851985+ * work with different options work we need to keep backward compatibility.20011986 */20021987static struct vfsmount *btrfs_reconfigure_for_mount(struct fs_context *fc)20031988{···20042019 if (IS_ERR(mnt))20052020 return mnt;2006202120072007- if (!fc->oldapi || !ro2rw)20222022+ if (!ro2rw)20082023 return mnt;2009202420102025 /* We need to convert to rw, call reconfigure. */
···205205 nfs_fscache_invalidate(inode, 0);206206 flags &= ~NFS_INO_REVAL_FORCED;207207208208- nfsi->cache_validity |= flags;208208+ flags |= nfsi->cache_validity;209209+ if (inode->i_mapping->nrpages == 0)210210+ flags &= ~NFS_INO_INVALID_DATA;209211210210- if (inode->i_mapping->nrpages == 0) {211211- nfsi->cache_validity &= ~NFS_INO_INVALID_DATA;212212- nfs_ooo_clear(nfsi);213213- } else if (nfsi->cache_validity & NFS_INO_INVALID_DATA) {212212+ /* pairs with nfs_clear_invalid_mapping()'s smp_load_acquire() */213213+ smp_store_release(&nfsi->cache_validity, flags);214214+215215+ if (inode->i_mapping->nrpages == 0 ||216216+ nfsi->cache_validity & NFS_INO_INVALID_DATA) {214217 nfs_ooo_clear(nfsi);215218 }216219 trace_nfs_set_cache_invalid(inode, 0);···631628 }632629}633630631631+static void nfs_update_timestamps(struct inode *inode, unsigned int ia_valid)632632+{633633+ enum file_time_flags time_flags = 0;634634+ unsigned int cache_flags = 0;635635+636636+ if (ia_valid & ATTR_MTIME) {637637+ time_flags |= S_MTIME | S_CTIME;638638+ cache_flags |= NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME;639639+ }640640+ if (ia_valid & ATTR_ATIME) {641641+ time_flags |= S_ATIME;642642+ cache_flags |= NFS_INO_INVALID_ATIME;643643+ }644644+ inode_update_timestamps(inode, time_flags);645645+ NFS_I(inode)->cache_validity &= ~cache_flags;646646+}647647+634648void nfs_update_delegated_atime(struct inode *inode)635649{636650 spin_lock(&inode->i_lock);637637- if (nfs_have_delegated_atime(inode)) {638638- inode_update_timestamps(inode, S_ATIME);639639- NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ATIME;640640- }651651+ if (nfs_have_delegated_atime(inode))652652+ nfs_update_timestamps(inode, ATTR_ATIME);641653 spin_unlock(&inode->i_lock);642654}643655644656void nfs_update_delegated_mtime_locked(struct inode *inode)645657{646646- if (nfs_have_delegated_mtime(inode)) {647647- inode_update_timestamps(inode, S_CTIME | S_MTIME);648648- NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_CTIME |649649- NFS_INO_INVALID_MTIME);650650- }658658+ if (nfs_have_delegated_mtime(inode))659659+ nfs_update_timestamps(inode, ATTR_MTIME);651660}652661653662void nfs_update_delegated_mtime(struct inode *inode)···697682 attr->ia_valid &= ~ATTR_SIZE;698683 }699684700700- if (nfs_have_delegated_mtime(inode)) {701701- if (attr->ia_valid & ATTR_MTIME) {702702- nfs_update_delegated_mtime(inode);703703- attr->ia_valid &= ~ATTR_MTIME;704704- }705705- if (attr->ia_valid & ATTR_ATIME) {706706- nfs_update_delegated_atime(inode);707707- attr->ia_valid &= ~ATTR_ATIME;708708- }685685+ if (nfs_have_delegated_mtime(inode) && attr->ia_valid & ATTR_MTIME) {686686+ spin_lock(&inode->i_lock);687687+ nfs_update_timestamps(inode, attr->ia_valid);688688+ spin_unlock(&inode->i_lock);689689+ attr->ia_valid &= ~(ATTR_MTIME | ATTR_ATIME);690690+ } else if (nfs_have_delegated_atime(inode) &&691691+ attr->ia_valid & ATTR_ATIME &&692692+ !(attr->ia_valid & ATTR_MTIME)) {693693+ nfs_update_delegated_atime(inode);694694+ attr->ia_valid &= ~ATTR_ATIME;709695 }710696711697 /* Optimization: if the end result is no change, don't RPC */···14241408 TASK_KILLABLE|TASK_FREEZABLE_UNSAFE);14251409 if (ret)14261410 goto out;14111411+ smp_rmb(); /* pairs with smp_wmb() below */14121412+ if (test_bit(NFS_INO_INVALIDATING, bitlock))14131413+ continue;14141414+ /* pairs with nfs_set_cache_invalid()'s smp_store_release() */14151415+ if (!(smp_load_acquire(&nfsi->cache_validity) & NFS_INO_INVALID_DATA))14161416+ goto out;14171417+ /* Slow-path that double-checks with spinlock held */14271418 spin_lock(&inode->i_lock);14281419 if (test_bit(NFS_INO_INVALIDATING, bitlock)) {14291420 spin_unlock(&inode->i_lock);···16561633 fattr->gencount = nfs_inc_attr_generation_counter();16571634 fattr->owner_name = NULL;16581635 fattr->group_name = NULL;16361636+ fattr->mdsthreshold = NULL;16591637}16601638EXPORT_SYMBOL_GPL(nfs_fattr_init);16611639
+2-1
fs/nfs/localio.c
···205205 nfs_local_disable(clp);206206 }207207208208- nfs_uuid_begin(&clp->cl_uuid);208208+ if (!nfs_uuid_begin(&clp->cl_uuid))209209+ return;209210 if (nfs_server_uuid_is_local(clp))210211 nfs_local_enable(clp);211212 nfs_uuid_end(&clp->cl_uuid);
+4
fs/nfs/nfs4proc.c
···34523452 adjust_flags |= NFS_INO_INVALID_MODE;34533453 if (sattr->ia_valid & (ATTR_UID | ATTR_GID))34543454 adjust_flags |= NFS_INO_INVALID_OTHER;34553455+ if (sattr->ia_valid & ATTR_ATIME)34563456+ adjust_flags |= NFS_INO_INVALID_ATIME;34573457+ if (sattr->ia_valid & ATTR_MTIME)34583458+ adjust_flags |= NFS_INO_INVALID_MTIME;3455345934563460 do {34573461 nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, fattr->label),
+9-1
fs/nfs/super.c
···885885 * Now ask the mount server to map our export path886886 * to a file handle.887887 */888888- status = nfs_mount(&request, ctx->timeo, ctx->retrans);888888+ if ((request.protocol == XPRT_TRANSPORT_UDP) ==889889+ !(ctx->flags & NFS_MOUNT_TCP))890890+ /*891891+ * NFS protocol and mount protocol are both UDP or neither UDP892892+ * so timeouts are compatible. Use NFS timeouts for MOUNT893893+ */894894+ status = nfs_mount(&request, ctx->timeo, ctx->retrans);895895+ else896896+ status = nfs_mount(&request, NFS_UNSPEC_TIMEO, NFS_UNSPEC_RETRANS);889897 if (status != 0) {890898 dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n",891899 request.hostname, status);
···315315316316void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit);317317318318-extern u64 smccc_has_sve_hint;319319-320318/**321319 * arm_smccc_get_soc_id_version()322320 *···413415};414416415417/**416416- * __arm_smccc_sve_check() - Set the SVE hint bit when doing SMC calls417417- *418418- * Sets the SMCCC hint bit to indicate if there is live state in the SVE419419- * registers, this modifies x0 in place and should never be called from C420420- * code.421421- */422422-asmlinkage unsigned long __arm_smccc_sve_check(unsigned long x0);423423-424424-/**425418 * __arm_smccc_smc() - make SMC calls426419 * @a0-a7: arguments passed in registers 0 to 7427420 * @res: result values from registers 0 to 3···476487477488#define SMCCC_SMC_INST __SMC(0)478489#define SMCCC_HVC_INST __HVC(0)479479-480480-#endif481481-482482-/* nVHE hypervisor doesn't have a current thread so needs separate checks */483483-#if defined(CONFIG_ARM64_SVE) && !defined(__KVM_NVHE_HYPERVISOR__)484484-485485-#define SMCCC_SVE_CHECK ALTERNATIVE("nop \n", "bl __arm_smccc_sve_check \n", \486486- ARM64_SVE)487487-#define smccc_sve_clobbers "x16", "x30", "cc",488488-489489-#else490490-491491-#define SMCCC_SVE_CHECK492492-#define smccc_sve_clobbers493490494491#endif495492···549574 register unsigned long r3 asm("r3"); \550575 CONCATENATE(__declare_arg_, \551576 COUNT_ARGS(__VA_ARGS__))(__VA_ARGS__); \552552- asm volatile(SMCCC_SVE_CHECK \553553- inst "\n" : \577577+ asm volatile(inst "\n" : \554578 "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) \555579 : CONCATENATE(__constraint_read_, \556580 COUNT_ARGS(__VA_ARGS__)) \557557- : smccc_sve_clobbers "memory"); \581581+ : "memory"); \558582 if (___res) \559583 *___res = (typeof(*___res)){r0, r1, r2, r3}; \560584 } while (0)···602628 asm ("" : \603629 : CONCATENATE(__constraint_read_, \604630 COUNT_ARGS(__VA_ARGS__)) \605605- : smccc_sve_clobbers "memory"); \631631+ : "memory"); \606632 if (___res) \607633 ___res->a0 = SMCCC_RET_NOT_SUPPORTED; \608634 } while (0)
+22-6
include/linux/mman.h
···22#ifndef _LINUX_MMAN_H33#define _LINUX_MMAN_H4455+#include <linux/fs.h>56#include <linux/mm.h>67#include <linux/percpu_counter.h>78···9594#endif96959796#ifndef arch_calc_vm_flag_bits9898-#define arch_calc_vm_flag_bits(flags) 09797+#define arch_calc_vm_flag_bits(file, flags) 09998#endif10099101100#ifndef arch_validate_prot···152151 * Combine the mmap "flags" argument into "vm_flags" used internally.153152 */154153static inline unsigned long155155-calc_vm_flag_bits(unsigned long flags)154154+calc_vm_flag_bits(struct file *file, unsigned long flags)156155{157156 return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) |158157 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) |159158 _calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |160159 _calc_vm_trans(flags, MAP_STACK, VM_NOHUGEPAGE) |161161- arch_calc_vm_flag_bits(flags);160160+ arch_calc_vm_flag_bits(file, flags);162161}163162164163unsigned long vm_commit_limit(void);···189188 *190189 * d) mmap(PROT_READ | PROT_EXEC)191190 * mmap(PROT_READ | PROT_EXEC | PROT_BTI)191191+ *192192+ * This is only applicable if the user has set the Memory-Deny-Write-Execute193193+ * (MDWE) protection mask for the current process.194194+ *195195+ * @old specifies the VMA flags the VMA originally possessed, and @new the ones196196+ * we propose to set.197197+ *198198+ * Return: false if proposed change is OK, true if not ok and should be denied.192199 */193193-static inline bool map_deny_write_exec(struct vm_area_struct *vma, unsigned long vm_flags)200200+static inline bool map_deny_write_exec(unsigned long old, unsigned long new)194201{202202+ /* If MDWE is disabled, we have nothing to deny. */195203 if (!test_bit(MMF_HAS_MDWE, ¤t->mm->flags))196204 return false;197205198198- if ((vm_flags & VM_EXEC) && (vm_flags & VM_WRITE))206206+ /* If the new VMA is not executable, we have nothing to deny. */207207+ if (!(new & VM_EXEC))208208+ return false;209209+210210+ /* Under MDWE we do not accept newly writably executable VMAs... */211211+ if (new & VM_WRITE)199212 return true;200213201201- if (!(vma->vm_flags & VM_EXEC) && (vm_flags & VM_EXEC))214214+ /* ...nor previously non-executable VMAs becoming executable. */215215+ if (!(old & VM_EXEC))202216 return true;203217204218 return false;
+1
include/linux/mmzone.h
···823823 unsigned long watermark_boost;824824825825 unsigned long nr_reserved_highatomic;826826+ unsigned long nr_free_highatomic;826827827828 /*828829 * We don't know if the memory that we're going to allocate will be
···125125 * @num_banks: Number of llcc banks126126 * @bitmap: Bit map to track the active slice ids127127 * @ecc_irq: interrupt for llcc cache error detection and reporting128128+ * @ecc_irq_configured: 'True' if firmware has already configured the irq propagation128129 * @version: Indicates the LLCC version129130 */130131struct llcc_drv_data {···140139 u32 num_banks;141140 unsigned long *bitmap;142141 int ecc_irq;142142+ bool ecc_irq_configured;143143 u32 version;144144};145145
···11031103 * @name: name of the chain11041104 * @udlen: user data length11051105 * @udata: user data in the chain11061106+ * @rcu_head: rcu head for deferred release11061107 * @blob_next: rule blob pointer to the next in the chain11071108 */11081109struct nft_chain {···11211120 char *name;11221121 u16 udlen;11231122 u8 *udata;11231123+ struct rcu_head rcu_head;1124112411251125 /* Only used during control plane commit phase: */11261126 struct nft_rule_blob *blob_next;···12651263 * @sets: sets in the table12661264 * @objects: stateful objects in the table12671265 * @flowtables: flow tables in the table12661266+ * @net: netnamespace this table belongs to12681267 * @hgenerator: handle generator state12691268 * @handle: table handle12701269 * @use: number of chain references to this table···12851282 struct list_head sets;12861283 struct list_head objects;12871284 struct list_head flowtables;12851285+ possible_net_t net;12881286 u64 hgenerator;12891287 u64 handle;12901288 u32 use;
+1
include/trace/events/rxrpc.h
···287287 EM(rxrpc_call_see_input, "SEE input ") \288288 EM(rxrpc_call_see_release, "SEE release ") \289289 EM(rxrpc_call_see_userid_exists, "SEE u-exists") \290290+ EM(rxrpc_call_see_waiting_call, "SEE q-conn ") \290291 E_(rxrpc_call_see_zap, "SEE zap ")291292292293#define rxrpc_txqueue_traces \
···5501550155025502static const char readme_msg[] =55035503 "tracing mini-HOWTO:\n\n"55045504+ "By default tracefs removes all OTH file permission bits.\n"55055505+ "When mounting tracefs an optional group id can be specified\n"55065506+ "which adds the group to every directory and file in tracefs:\n\n"55075507+ "\t e.g. mount -t tracefs [-o [gid=<gid>]] nodev /sys/kernel/tracing\n\n"55045508 "# echo 0 > tracing_on : quick way to disable tracing\n"55055509 "# echo 1 > tracing_on : quick way to re-enable tracing\n\n"55065510 " Important files:\n"
+5-4
kernel/ucount.c
···307307 do_dec_rlimit_put_ucounts(ucounts, NULL, type);308308}309309310310-long inc_rlimit_get_ucounts(struct ucounts *ucounts, enum rlimit_type type)310310+long inc_rlimit_get_ucounts(struct ucounts *ucounts, enum rlimit_type type,311311+ bool override_rlimit)311312{312313 /* Caller must hold a reference to ucounts */313314 struct ucounts *iter;···318317 for (iter = ucounts; iter; iter = iter->ns->ucounts) {319318 long new = atomic_long_add_return(1, &iter->rlimit[type]);320319 if (new < 0 || new > max)321321- goto unwind;320320+ goto dec_unwind;322321 if (iter == ucounts)323322 ret = new;324324- max = get_userns_rlimit_max(iter->ns, type);323323+ if (!override_rlimit)324324+ max = get_userns_rlimit_max(iter->ns, type);325325 /*326326 * Grab an extra ucount reference for the caller when327327 * the rlimit count was previously 0.···336334dec_unwind:337335 dec = atomic_long_sub_return(1, &iter->rlimit[type]);338336 WARN_ON_ONCE(dec < 0);339339-unwind:340337 do_dec_rlimit_put_ucounts(ucounts, iter, type);341338 return 0;342339}
+12-6
lib/objpool.c
···7474 * warm caches and TLB hits. in default vmalloc is used to7575 * reduce the pressure of kernel slab system. as we know,7676 * mimimal size of vmalloc is one page since vmalloc would7777- * always align the requested size to page size7777+ * always align the requested size to page size.7878+ * but if vmalloc fails or it is not available (e.g. GFP_ATOMIC)7979+ * allocate percpu slot with kmalloc.7880 */7979- if ((pool->gfp & GFP_ATOMIC) == GFP_ATOMIC)8080- slot = kmalloc_node(size, pool->gfp, cpu_to_node(i));8181- else8181+ slot = NULL;8282+8383+ if ((pool->gfp & (GFP_ATOMIC | GFP_KERNEL)) != GFP_ATOMIC)8284 slot = __vmalloc_node(size, sizeof(void *), pool->gfp,8385 cpu_to_node(i), __builtin_return_address(0));8484- if (!slot)8585- return -ENOMEM;8686+8787+ if (!slot) {8888+ slot = kmalloc_node(size, pool->gfp, cpu_to_node(i));8989+ if (!slot)9090+ return -ENOMEM;9191+ }8692 memset(slot, 0, size);8793 pool->cpu_slots[i] = slot;8894
+28-14
mm/damon/core.c
···14121412 damon_for_each_scheme(s, c) {14131413 struct damos_quota *quota = &s->quota;1414141414151415- if (c->passed_sample_intervals != s->next_apply_sis)14151415+ if (c->passed_sample_intervals < s->next_apply_sis)14161416 continue;1417141714181418 if (!s->wmarks.activated)···14561456 unsigned long score)14571457{14581458 const unsigned long goal = 10000;14591459- unsigned long score_goal_diff = max(goal, score) - min(goal, score);14601460- unsigned long score_goal_diff_bp = score_goal_diff * 10000 / goal;14611461- unsigned long compensation = last_input * score_goal_diff_bp / 10000;14621459 /* Set minimum input as 10000 to avoid compensation be zero */14631460 const unsigned long min_input = 10000;14611461+ unsigned long score_goal_diff, compensation;14621462+ bool over_achieving = score > goal;1464146314651465- if (goal > score)14641464+ if (score == goal)14651465+ return last_input;14661466+ if (score >= goal * 2)14671467+ return min_input;14681468+14691469+ if (over_achieving)14701470+ score_goal_diff = score - goal;14711471+ else14721472+ score_goal_diff = goal - score;14731473+14741474+ if (last_input < ULONG_MAX / score_goal_diff)14751475+ compensation = last_input * score_goal_diff / goal;14761476+ else14771477+ compensation = last_input / goal * score_goal_diff;14781478+14791479+ if (over_achieving)14801480+ return max(last_input - compensation, min_input);14811481+ if (last_input < ULONG_MAX - compensation)14661482 return last_input + compensation;14671467- if (last_input > compensation + min_input)14681468- return last_input - compensation;14691469- return min_input;14831483+ return ULONG_MAX;14701484}1471148514721486#ifdef CONFIG_PSI···16361622 bool has_schemes_to_apply = false;1637162316381624 damon_for_each_scheme(s, c) {16391639- if (c->passed_sample_intervals != s->next_apply_sis)16251625+ if (c->passed_sample_intervals < s->next_apply_sis)16401626 continue;1641162716421628 if (!s->wmarks.activated)···16561642 }1657164316581644 damon_for_each_scheme(s, c) {16591659- if (c->passed_sample_intervals != s->next_apply_sis)16451645+ if (c->passed_sample_intervals < s->next_apply_sis)16601646 continue;16611661- s->next_apply_sis +=16471647+ s->next_apply_sis = c->passed_sample_intervals +16621648 (s->apply_interval_us ? s->apply_interval_us :16631649 c->attrs.aggr_interval) / sample_interval;16641650 }···20142000 if (ctx->ops.check_accesses)20152001 max_nr_accesses = ctx->ops.check_accesses(ctx);2016200220172017- if (ctx->passed_sample_intervals == next_aggregation_sis) {20032003+ if (ctx->passed_sample_intervals >= next_aggregation_sis) {20182004 kdamond_merge_regions(ctx,20192005 max_nr_accesses / 10,20202006 sz_limit);···2032201820332019 sample_interval = ctx->attrs.sample_interval ?20342020 ctx->attrs.sample_interval : 1;20352035- if (ctx->passed_sample_intervals == next_aggregation_sis) {20212021+ if (ctx->passed_sample_intervals >= next_aggregation_sis) {20362022 ctx->next_aggregation_sis = next_aggregation_sis +20372023 ctx->attrs.aggr_interval / sample_interval;20382024···20422028 ctx->ops.reset_aggregated(ctx);20432029 }2044203020452045- if (ctx->passed_sample_intervals == next_ops_update_sis) {20312031+ if (ctx->passed_sample_intervals >= next_ops_update_sis) {20462032 ctx->next_ops_update_sis = next_ops_update_sis +20472033 ctx->attrs.ops_update_interval /20482034 sample_interval;
+1-1
mm/filemap.c
···26252625 if (unlikely(!iov_iter_count(iter)))26262626 return 0;2627262726282628- iov_iter_truncate(iter, inode->i_sb->s_maxbytes);26282628+ iov_iter_truncate(iter, inode->i_sb->s_maxbytes - iocb->ki_pos);26292629 folio_batch_init(&fbatch);2630263026312631 do {
+43-13
mm/huge_memory.c
···35883588 return split_huge_page_to_list_to_order(&folio->page, list, ret);35893589}3590359035913591-void __folio_undo_large_rmappable(struct folio *folio)35913591+/*35923592+ * __folio_unqueue_deferred_split() is not to be called directly:35933593+ * the folio_unqueue_deferred_split() inline wrapper in mm/internal.h35943594+ * limits its calls to those folios which may have a _deferred_list for35953595+ * queueing THP splits, and that list is (racily observed to be) non-empty.35963596+ *35973597+ * It is unsafe to call folio_unqueue_deferred_split() until folio refcount is35983598+ * zero: because even when split_queue_lock is held, a non-empty _deferred_list35993599+ * might be in use on deferred_split_scan()'s unlocked on-stack list.36003600+ *36013601+ * If memory cgroups are enabled, split_queue_lock is in the mem_cgroup: it is36023602+ * therefore important to unqueue deferred split before changing folio memcg.36033603+ */36043604+bool __folio_unqueue_deferred_split(struct folio *folio)35923605{35933606 struct deferred_split *ds_queue;35943607 unsigned long flags;36083608+ bool unqueued = false;36093609+36103610+ WARN_ON_ONCE(folio_ref_count(folio));36113611+ WARN_ON_ONCE(!mem_cgroup_disabled() && !folio_memcg(folio));3595361235963613 ds_queue = get_deferred_split_queue(folio);35973614 spin_lock_irqsave(&ds_queue->split_queue_lock, flags);···36203603 MTHP_STAT_NR_ANON_PARTIALLY_MAPPED, -1);36213604 }36223605 list_del_init(&folio->_deferred_list);36063606+ unqueued = true;36233607 }36243608 spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);36093609+36103610+ return unqueued; /* useful for debug warnings */36253611}3626361236273613/* partially_mapped=false won't clear PG_partially_mapped folio flag */···36473627 return;3648362836493629 /*36503650- * The try_to_unmap() in page reclaim path might reach here too,36513651- * this may cause a race condition to corrupt deferred split queue.36523652- * And, if page reclaim is already handling the same folio, it is36533653- * unnecessary to handle it again in shrinker.36543654- *36553655- * Check the swapcache flag to determine if the folio is being36563656- * handled by page reclaim since THP swap would add the folio into36573657- * swap cache before calling try_to_unmap().36303630+ * Exclude swapcache: originally to avoid a corrupt deferred split36313631+ * queue. Nowadays that is fully prevented by mem_cgroup_swapout();36323632+ * but if page reclaim is already handling the same folio, it is36333633+ * unnecessary to handle it again in the shrinker, so excluding36343634+ * swapcache here may still be a useful optimization.36583635 */36593636 if (folio_test_swapcache(folio))36603637 return;···37353718 struct deferred_split *ds_queue = &pgdata->deferred_split_queue;37363719 unsigned long flags;37373720 LIST_HEAD(list);37383738- struct folio *folio, *next;37393739- int split = 0;37213721+ struct folio *folio, *next, *prev = NULL;37223722+ int split = 0, removed = 0;3740372337413724#ifdef CONFIG_MEMCG37423725 if (sc->memcg)···37923775 */37933776 if (!did_split && !folio_test_partially_mapped(folio)) {37943777 list_del_init(&folio->_deferred_list);37953795- ds_queue->split_queue_len--;37783778+ removed++;37793779+ } else {37803780+ /*37813781+ * That unlocked list_del_init() above would be unsafe,37823782+ * unless its folio is separated from any earlier folios37833783+ * left on the list (which may be concurrently unqueued)37843784+ * by one safe folio with refcount still raised.37853785+ */37863786+ swap(folio, prev);37963787 }37973797- folio_put(folio);37883788+ if (folio)37893789+ folio_put(folio);37983790 }3799379138003792 spin_lock_irqsave(&ds_queue->split_queue_lock, flags);38013793 list_splice_tail(&list, &ds_queue->split_queue);37943794+ ds_queue->split_queue_len -= removed;38023795 spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);37963796+37973797+ if (prev)37983798+ folio_put(prev);3803379938043800 /*38053801 * Stop shrinker if we didn't split any page, but the queue is empty.
+50-5
mm/internal.h
···108108 return (void *)(mapping & ~PAGE_MAPPING_FLAGS);109109}110110111111+/*112112+ * This is a file-backed mapping, and is about to be memory mapped - invoke its113113+ * mmap hook and safely handle error conditions. On error, VMA hooks will be114114+ * mutated.115115+ *116116+ * @file: File which backs the mapping.117117+ * @vma: VMA which we are mapping.118118+ *119119+ * Returns: 0 if success, error otherwise.120120+ */121121+static inline int mmap_file(struct file *file, struct vm_area_struct *vma)122122+{123123+ int err = call_mmap(file, vma);124124+125125+ if (likely(!err))126126+ return 0;127127+128128+ /*129129+ * OK, we tried to call the file hook for mmap(), but an error130130+ * arose. The mapping is in an inconsistent state and we most not invoke131131+ * any further hooks on it.132132+ */133133+ vma->vm_ops = &vma_dummy_vm_ops;134134+135135+ return err;136136+}137137+138138+/*139139+ * If the VMA has a close hook then close it, and since closing it might leave140140+ * it in an inconsistent state which makes the use of any hooks suspect, clear141141+ * them down by installing dummy empty hooks.142142+ */143143+static inline void vma_close(struct vm_area_struct *vma)144144+{145145+ if (vma->vm_ops && vma->vm_ops->close) {146146+ vma->vm_ops->close(vma);147147+148148+ /*149149+ * The mapping is in an inconsistent state, and no further hooks150150+ * may be invoked upon it.151151+ */152152+ vma->vm_ops = &vma_dummy_vm_ops;153153+ }154154+}155155+111156#ifdef CONFIG_MMU112157113158/* Flags for folio_pte_batch(). */···684639#endif685640}686641687687-void __folio_undo_large_rmappable(struct folio *folio);688688-static inline void folio_undo_large_rmappable(struct folio *folio)642642+bool __folio_unqueue_deferred_split(struct folio *folio);643643+static inline bool folio_unqueue_deferred_split(struct folio *folio)689644{690645 if (folio_order(folio) <= 1 || !folio_test_large_rmappable(folio))691691- return;646646+ return false;692647693648 /*694649 * At this point, there is no one trying to add the folio to···696651 * to check without acquiring the split_queue_lock.697652 */698653 if (data_race(list_empty(&folio->_deferred_list)))699699- return;654654+ return false;700655701701- __folio_undo_large_rmappable(folio);656656+ return __folio_unqueue_deferred_split(folio);702657}703658704659static inline struct folio *page_rmappable_folio(struct page *page)
+25
mm/memcontrol-v1.c
···848848 css_get(&to->css);849849 css_put(&from->css);850850851851+ /* Warning should never happen, so don't worry about refcount non-0 */852852+ WARN_ON_ONCE(folio_unqueue_deferred_split(folio));851853 folio->memcg_data = (unsigned long)to;852854853855 __folio_memcg_unlock(from);···12191217 enum mc_target_type target_type;12201218 union mc_target target;12211219 struct folio *folio;12201220+ bool tried_split_before = false;1222122112221222+retry_pmd:12231223 ptl = pmd_trans_huge_lock(pmd, vma);12241224 if (ptl) {12251225 if (mc.precharge < HPAGE_PMD_NR) {···12311227 target_type = get_mctgt_type_thp(vma, addr, *pmd, &target);12321228 if (target_type == MC_TARGET_PAGE) {12331229 folio = target.folio;12301230+ /*12311231+ * Deferred split queue locking depends on memcg,12321232+ * and unqueue is unsafe unless folio refcount is 0:12331233+ * split or skip if on the queue? first try to split.12341234+ */12351235+ if (!list_empty(&folio->_deferred_list)) {12361236+ spin_unlock(ptl);12371237+ if (!tried_split_before)12381238+ split_folio(folio);12391239+ folio_unlock(folio);12401240+ folio_put(folio);12411241+ if (tried_split_before)12421242+ return 0;12431243+ tried_split_before = true;12441244+ goto retry_pmd;12451245+ }12461246+ /*12471247+ * So long as that pmd lock is held, the folio cannot12481248+ * be racily added to the _deferred_list, because12491249+ * __folio_remove_rmap() will find !partially_mapped.12501250+ */12341251 if (folio_isolate_lru(folio)) {12351252 if (!mem_cgroup_move_account(folio, true,12361253 mc.from, mc.to)) {
+5-4
mm/memcontrol.c
···46294629 struct obj_cgroup *objcg;4630463046314631 VM_BUG_ON_FOLIO(folio_test_lru(folio), folio);46324632- VM_BUG_ON_FOLIO(folio_order(folio) > 1 &&46334633- !folio_test_hugetlb(folio) &&46344634- !list_empty(&folio->_deferred_list) &&46354635- folio_test_partially_mapped(folio), folio);4636463246374633 /*46384634 * Nobody should be changing or seriously looking at···46754679 ug->nr_memory += nr_pages;46764680 ug->pgpgout++;4677468146824682+ WARN_ON_ONCE(folio_unqueue_deferred_split(folio));46784683 folio->memcg_data = 0;46794684 }46804685···4787479047884791 /* Transfer the charge and the css ref */47894792 commit_charge(new, memcg);47934793+47944794+ /* Warning should never happen, so don't worry about refcount non-0 */47954795+ WARN_ON_ONCE(folio_unqueue_deferred_split(old));47904796 old->memcg_data = 0;47914797}47924798···49764976 VM_BUG_ON_FOLIO(oldid, folio);49774977 mod_memcg_state(swap_memcg, MEMCG_SWAP, nr_entries);4978497849794979+ folio_unqueue_deferred_split(folio);49794980 folio->memcg_data = 0;4980498149814982 if (!mem_cgroup_is_root(memcg))
+2-2
mm/migrate.c
···490490 folio_test_large_rmappable(folio)) {491491 if (!folio_ref_freeze(folio, expected_count))492492 return -EAGAIN;493493- folio_undo_large_rmappable(folio);493493+ folio_unqueue_deferred_split(folio);494494 folio_ref_unfreeze(folio, expected_count);495495 }496496···515515 }516516517517 /* Take off deferred split queue while frozen and memcg set */518518- folio_undo_large_rmappable(folio);518518+ folio_unqueue_deferred_split(folio);519519520520 /*521521 * Now we know that no one else is looking at the folio:
···344344 * to. we assume access permissions have been handled by the open345345 * of the memory object, so we don't do any here.346346 */347347- vm_flags |= calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(flags) |347347+ vm_flags |= calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(file, flags) |348348 mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;349349350350 /* Obtain the address to map to. we verify (or select) it and ensure···13581358 return do_vmi_munmap(&vmi, mm, start, len, uf, false);13591359}1360136013611361-unsigned long mmap_region(struct file *file, unsigned long addr,13611361+static unsigned long __mmap_region(struct file *file, unsigned long addr,13621362 unsigned long len, vm_flags_t vm_flags, unsigned long pgoff,13631363 struct list_head *uf)13641364{13651365 struct mm_struct *mm = current->mm;13661366 struct vm_area_struct *vma = NULL;13671367 pgoff_t pglen = PHYS_PFN(len);13681368- struct vm_area_struct *merge;13691368 unsigned long charged = 0;13701369 struct vma_munmap_struct vms;13711370 struct ma_state mas_detach;13721371 struct maple_tree mt_detach;13731372 unsigned long end = addr + len;13741374- bool writable_file_mapping = false;13751373 int error;13761374 VMA_ITERATOR(vmi, mm, addr);13771375 VMG_STATE(vmg, mm, &vmi, addr, end, vm_flags, pgoff);···14201422 /*14211423 * clear PTEs while the vma is still in the tree so that rmap14221424 * cannot race with the freeing later in the truncate scenario.14231423- * This is also needed for call_mmap(), which is why vm_ops14251425+ * This is also needed for mmap_file(), which is why vm_ops14241426 * close function is called.14251427 */14261428 vms_clean_up_area(&vms, &mas_detach);···14431445 vm_flags_init(vma, vm_flags);14441446 vma->vm_page_prot = vm_get_page_prot(vm_flags);1445144714481448+ if (vma_iter_prealloc(&vmi, vma)) {14491449+ error = -ENOMEM;14501450+ goto free_vma;14511451+ }14521452+14461453 if (file) {14471454 vma->vm_file = get_file(file);14481448- error = call_mmap(file, vma);14551455+ error = mmap_file(file, vma);14491456 if (error)14501450- goto unmap_and_free_vma;14571457+ goto unmap_and_free_file_vma;1451145814521452- if (vma_is_shared_maywrite(vma)) {14531453- error = mapping_map_writable(file->f_mapping);14541454- if (error)14551455- goto close_and_free_vma;14561456-14571457- writable_file_mapping = true;14581458- }14591459-14591459+ /* Drivers cannot alter the address of the VMA. */14601460+ WARN_ON_ONCE(addr != vma->vm_start);14601461 /*14611461- * Expansion is handled above, merging is handled below.14621462- * Drivers should not alter the address of the VMA.14621462+ * Drivers should not permit writability when previously it was14631463+ * disallowed.14631464 */14641464- if (WARN_ON((addr != vma->vm_start))) {14651465- error = -EINVAL;14661466- goto close_and_free_vma;14671467- }14651465+ VM_WARN_ON_ONCE(vm_flags != vma->vm_flags &&14661466+ !(vm_flags & VM_MAYWRITE) &&14671467+ (vma->vm_flags & VM_MAYWRITE));1468146814691469 vma_iter_config(&vmi, addr, end);14701470 /*14711471- * If vm_flags changed after call_mmap(), we should try merge14711471+ * If vm_flags changed after mmap_file(), we should try merge14721472 * vma again as we may succeed this time.14731473 */14741474 if (unlikely(vm_flags != vma->vm_flags && vmg.prev)) {14751475+ struct vm_area_struct *merge;14761476+14751477 vmg.flags = vma->vm_flags;14761478 /* If this fails, state is reset ready for a reattempt. */14771479 merge = vma_merge_new_range(&vmg);···14891491 vma = merge;14901492 /* Update vm_flags to pick up the change. */14911493 vm_flags = vma->vm_flags;14921492- goto unmap_writable;14941494+ goto file_expanded;14931495 }14941496 vma_iter_config(&vmi, addr, end);14951497 }···14981500 } else if (vm_flags & VM_SHARED) {14991501 error = shmem_zero_setup(vma);15001502 if (error)15011501- goto free_vma;15031503+ goto free_iter_vma;15021504 } else {15031505 vma_set_anonymous(vma);15041506 }1505150715061506- if (map_deny_write_exec(vma, vma->vm_flags)) {15071507- error = -EACCES;15081508- goto close_and_free_vma;15091509- }15101510-15111511- /* Allow architectures to sanity-check the vm_flags */15121512- if (!arch_validate_flags(vma->vm_flags)) {15131513- error = -EINVAL;15141514- goto close_and_free_vma;15151515- }15161516-15171517- if (vma_iter_prealloc(&vmi, vma)) {15181518- error = -ENOMEM;15191519- goto close_and_free_vma;15201520- }15081508+#ifdef CONFIG_SPARC6415091509+ /* TODO: Fix SPARC ADI! */15101510+ WARN_ON_ONCE(!arch_validate_flags(vm_flags));15111511+#endif1521151215221513 /* Lock the VMA since it is modified after insertion into VMA tree */15231514 vma_start_write(vma);···15201533 */15211534 khugepaged_enter_vma(vma, vma->vm_flags);1522153515231523- /* Once vma denies write, undo our temporary denial count */15241524-unmap_writable:15251525- if (writable_file_mapping)15261526- mapping_unmap_writable(file->f_mapping);15361536+file_expanded:15271537 file = vma->vm_file;15281538 ksm_add_vma(vma);15291539expanded:···1553156915541570 vma_set_page_prot(vma);1555157115561556- validate_mm(mm);15571572 return addr;1558157315591559-close_and_free_vma:15601560- if (file && !vms.closed_vm_ops && vma->vm_ops && vma->vm_ops->close)15611561- vma->vm_ops->close(vma);15741574+unmap_and_free_file_vma:15751575+ fput(vma->vm_file);15761576+ vma->vm_file = NULL;1562157715631563- if (file || vma->vm_file) {15641564-unmap_and_free_vma:15651565- fput(vma->vm_file);15661566- vma->vm_file = NULL;15671567-15681568- vma_iter_set(&vmi, vma->vm_end);15691569- /* Undo any partial mapping done by a device driver. */15701570- unmap_region(&vmi.mas, vma, vmg.prev, vmg.next);15711571- }15721572- if (writable_file_mapping)15731573- mapping_unmap_writable(file->f_mapping);15781578+ vma_iter_set(&vmi, vma->vm_end);15791579+ /* Undo any partial mapping done by a device driver. */15801580+ unmap_region(&vmi.mas, vma, vmg.prev, vmg.next);15811581+free_iter_vma:15821582+ vma_iter_free(&vmi);15741583free_vma:15751584 vm_area_free(vma);15761585unacct_error:···15731596abort_munmap:15741597 vms_abort_munmap_vmas(&vms, &mas_detach);15751598gather_failed:15761576- validate_mm(mm);15771599 return error;16001600+}16011601+16021602+unsigned long mmap_region(struct file *file, unsigned long addr,16031603+ unsigned long len, vm_flags_t vm_flags, unsigned long pgoff,16041604+ struct list_head *uf)16051605+{16061606+ unsigned long ret;16071607+ bool writable_file_mapping = false;16081608+16091609+ /* Check to see if MDWE is applicable. */16101610+ if (map_deny_write_exec(vm_flags, vm_flags))16111611+ return -EACCES;16121612+16131613+ /* Allow architectures to sanity-check the vm_flags. */16141614+ if (!arch_validate_flags(vm_flags))16151615+ return -EINVAL;16161616+16171617+ /* Map writable and ensure this isn't a sealed memfd. */16181618+ if (file && is_shared_maywrite(vm_flags)) {16191619+ int error = mapping_map_writable(file->f_mapping);16201620+16211621+ if (error)16221622+ return error;16231623+ writable_file_mapping = true;16241624+ }16251625+16261626+ ret = __mmap_region(file, addr, len, vm_flags, pgoff, uf);16271627+16281628+ /* Clear our write mapping regardless of error. */16291629+ if (writable_file_mapping)16301630+ mapping_unmap_writable(file->f_mapping);16311631+16321632+ validate_mm(current->mm);16331633+ return ret;15781634}1579163515801636static int __vm_munmap(unsigned long start, size_t len, bool unlock)···19441934 do {19451935 if (vma->vm_flags & VM_ACCOUNT)19461936 nr_accounted += vma_pages(vma);19471947- remove_vma(vma, /* unreachable = */ true, /* closed = */ false);19371937+ remove_vma(vma, /* unreachable = */ true);19481938 count++;19491939 cond_resched();19501940 vma = vma_next(&vmi);
+1-1
mm/mprotect.c
···810810 break;811811 }812812813813- if (map_deny_write_exec(vma, newflags)) {813813+ if (map_deny_write_exec(vma->vm_flags, newflags)) {814814 error = -EACCES;815815 break;816816 }
+4-5
mm/nommu.c
···589589 */590590static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)591591{592592- if (vma->vm_ops && vma->vm_ops->close)593593- vma->vm_ops->close(vma);592592+ vma_close(vma);594593 if (vma->vm_file)595594 fput(vma->vm_file);596595 put_nommu_region(vma->vm_region);···842843{843844 unsigned long vm_flags;844845845845- vm_flags = calc_vm_prot_bits(prot, 0) | calc_vm_flag_bits(flags);846846+ vm_flags = calc_vm_prot_bits(prot, 0) | calc_vm_flag_bits(file, flags);846847847848 if (!file) {848849 /*···884885{885886 int ret;886887887887- ret = call_mmap(vma->vm_file, vma);888888+ ret = mmap_file(vma->vm_file, vma);888889 if (ret == 0) {889890 vma->vm_region->vm_top = vma->vm_region->vm_end;890891 return 0;···917918 * happy.918919 */919920 if (capabilities & NOMMU_MAP_DIRECT) {920920- ret = call_mmap(vma->vm_file, vma);921921+ ret = mmap_file(vma->vm_file, vma);921922 /* shouldn't return success if we're not sharing */922923 if (WARN_ON_ONCE(!is_nommu_shared_mapping(vma->vm_flags)))923924 ret = -ENOSYS;
+9-7
mm/page_alloc.c
···635635static inline void account_freepages(struct zone *zone, int nr_pages,636636 int migratetype)637637{638638+ lockdep_assert_held(&zone->lock);639639+638640 if (is_migrate_isolate(migratetype))639641 return;640642···644642645643 if (is_migrate_cma(migratetype))646644 __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);645645+ else if (is_migrate_highatomic(migratetype))646646+ WRITE_ONCE(zone->nr_free_highatomic,647647+ zone->nr_free_highatomic + nr_pages);647648}648649649650/* Used for pages not on another list */···966961 break;967962 case 2:968963 /* the second tail page: deferred_list overlaps ->mapping */969969- if (unlikely(!list_empty(&folio->_deferred_list) &&970970- folio_test_partially_mapped(folio))) {971971- bad_page(page, "partially mapped folio on deferred list");964964+ if (unlikely(!list_empty(&folio->_deferred_list))) {965965+ bad_page(page, "on deferred list");972966 goto out;973967 }974968 break;···26862682 unsigned long pfn = folio_pfn(folio);26872683 unsigned int order = folio_order(folio);2688268426892689- folio_undo_large_rmappable(folio);26902685 if (!free_pages_prepare(&folio->page, order))26912686 continue;26922687 /*···3084308130853082 /*30863083 * If the caller does not have rights to reserves below the min30873087- * watermark then subtract the high-atomic reserves. This will30883088- * over-estimate the size of the atomic reserve but it avoids a search.30843084+ * watermark then subtract the free pages reserved for highatomic.30893085 */30903086 if (likely(!(alloc_flags & ALLOC_RESERVES)))30913091- unusable_free += z->nr_reserved_highatomic;30873087+ unusable_free += READ_ONCE(z->nr_free_highatomic);3092308830933089#ifdef CONFIG_CMA30943090 /* If allocation can't use CMA areas don't use free CMA pages */
-3
mm/shmem.c
···27332733 if (ret)27342734 return ret;2735273527362736- /* arm64 - allow memory tagging on RAM-based files */27372737- vm_flags_set(vma, VM_MTE_ALLOWED);27382738-27392736 file_accessed(file);27402737 /* This is anonymous shared memory if it is unlinked at the time of mmap */27412738 if (inode->i_nlink)
+20-11
mm/slab_common.c
···380380 unsigned int usersize,381381 void (*ctor)(void *))382382{383383+ unsigned long mask = 0;384384+ unsigned int idx;383385 kmem_buckets *b;384384- int idx;386386+387387+ BUILD_BUG_ON(ARRAY_SIZE(kmalloc_caches[KMALLOC_NORMAL]) > BITS_PER_LONG);385388386389 /*387390 * When the separate buckets API is not built in, just return···406403 for (idx = 0; idx < ARRAY_SIZE(kmalloc_caches[KMALLOC_NORMAL]); idx++) {407404 char *short_size, *cache_name;408405 unsigned int cache_useroffset, cache_usersize;409409- unsigned int size;406406+ unsigned int size, aligned_idx;410407411408 if (!kmalloc_caches[KMALLOC_NORMAL][idx])412409 continue;···419416 if (WARN_ON(!short_size))420417 goto fail;421418422422- cache_name = kasprintf(GFP_KERNEL, "%s-%s", name, short_size + 1);423423- if (WARN_ON(!cache_name))424424- goto fail;425425-426419 if (useroffset >= size) {427420 cache_useroffset = 0;428421 cache_usersize = 0;···426427 cache_useroffset = useroffset;427428 cache_usersize = min(size - cache_useroffset, usersize);428429 }429429- (*b)[idx] = kmem_cache_create_usercopy(cache_name, size,430430+431431+ aligned_idx = __kmalloc_index(size, false);432432+ if (!(*b)[aligned_idx]) {433433+ cache_name = kasprintf(GFP_KERNEL, "%s-%s", name, short_size + 1);434434+ if (WARN_ON(!cache_name))435435+ goto fail;436436+ (*b)[aligned_idx] = kmem_cache_create_usercopy(cache_name, size,430437 0, flags, cache_useroffset,431438 cache_usersize, ctor);432432- kfree(cache_name);433433- if (WARN_ON(!(*b)[idx]))434434- goto fail;439439+ kfree(cache_name);440440+ if (WARN_ON(!(*b)[aligned_idx]))441441+ goto fail;442442+ set_bit(aligned_idx, &mask);443443+ }444444+ if (idx != aligned_idx)445445+ (*b)[idx] = (*b)[aligned_idx];435446 }436447437448 return b;438449439450fail:440440- for (idx = 0; idx < ARRAY_SIZE(kmalloc_caches[KMALLOC_NORMAL]); idx++)451451+ for_each_set_bit(idx, &mask, ARRAY_SIZE(kmalloc_caches[KMALLOC_NORMAL]))441452 kmem_cache_destroy((*b)[idx]);442453 kmem_cache_free(kmem_buckets_cache, b);443454
···323323/*324324 * Close a vm structure and free it.325325 */326326-void remove_vma(struct vm_area_struct *vma, bool unreachable, bool closed)326326+void remove_vma(struct vm_area_struct *vma, bool unreachable)327327{328328 might_sleep();329329- if (!closed && vma->vm_ops && vma->vm_ops->close)330330- vma->vm_ops->close(vma);329329+ vma_close(vma);331330 if (vma->vm_file)332331 fput(vma->vm_file);333332 mpol_put(vma_policy(vma));···11141115 vms_clear_ptes(vms, mas_detach, true);11151116 mas_set(mas_detach, 0);11161117 mas_for_each(mas_detach, vma, ULONG_MAX)11171117- if (vma->vm_ops && vma->vm_ops->close)11181118- vma->vm_ops->close(vma);11191119- vms->closed_vm_ops = true;11181118+ vma_close(vma);11201119}1121112011221121/*···11571160 /* Remove and clean up vmas */11581161 mas_set(mas_detach, 0);11591162 mas_for_each(mas_detach, vma, ULONG_MAX)11601160- remove_vma(vma, /* = */ false, vms->closed_vm_ops);11631163+ remove_vma(vma, /* unreachable = */ false);1161116411621165 vm_unacct_memory(vms->nr_accounted);11631166 validate_mm(mm);···16811684 return new_vma;1682168516831686out_vma_link:16841684- if (new_vma->vm_ops && new_vma->vm_ops->close)16851685- new_vma->vm_ops->close(new_vma);16871687+ vma_close(new_vma);1686168816871689 if (new_vma->vm_file)16881690 fput(new_vma->vm_file);
+2-4
mm/vma.h
···4242 int vma_count; /* Number of vmas that will be removed */4343 bool unlock; /* Unlock after the munmap */4444 bool clear_ptes; /* If there are outstanding PTE to be cleared */4545- bool closed_vm_ops; /* call_mmap() was encountered, so vmas may be closed */4646- /* 1 byte hole */4545+ /* 2 byte hole */4746 unsigned long nr_pages; /* Number of pages being removed */4847 unsigned long locked_vm; /* Number of locked pages */4948 unsigned long nr_accounted; /* Number of VM_ACCOUNT pages */···197198 vms->unmap_start = FIRST_USER_ADDRESS;198199 vms->unmap_end = USER_PGTABLES_CEILING;199200 vms->clear_ptes = false;200200- vms->closed_vm_ops = false;201201}202202#endif203203···267269 unsigned long start, size_t len, struct list_head *uf,268270 bool unlock);269271270270-void remove_vma(struct vm_area_struct *vma, bool unreachable, bool closed);272272+void remove_vma(struct vm_area_struct *vma, bool unreachable);271273272274void unmap_region(struct ma_state *mas, struct vm_area_struct *vma,273275 struct vm_area_struct *prev, struct vm_area_struct *next);
+2-2
mm/vmscan.c
···14761476 */14771477 nr_reclaimed += nr_pages;1478147814791479- folio_undo_large_rmappable(folio);14791479+ folio_unqueue_deferred_split(folio);14801480 if (folio_batch_add(&free_folios, folio) == 0) {14811481 mem_cgroup_uncharge_folios(&free_folios);14821482 try_to_unmap_flush();···18641864 if (unlikely(folio_put_testzero(folio))) {18651865 __folio_clear_lru_flags(folio);1866186618671867- folio_undo_large_rmappable(folio);18671867+ folio_unqueue_deferred_split(folio);18681868 if (folio_batch_add(&free_folios, folio) == 0) {18691869 spin_unlock_irq(&lruvec->lru_lock);18701870 mem_cgroup_uncharge_folios(&free_folios);
···516516517517 spin_lock(&local->client_call_lock);518518 list_move_tail(&call->wait_link, &bundle->waiting_calls);519519+ rxrpc_see_call(call, rxrpc_call_see_waiting_call);519520 spin_unlock(&local->client_call_lock);520521521522 if (rxrpc_bundle_has_space(bundle))···587586 _debug("call is waiting");588587 ASSERTCMP(call->call_id, ==, 0);589588 ASSERT(!test_bit(RXRPC_CALL_EXPOSED, &call->flags));589589+ /* May still be on ->new_client_calls. */590590+ spin_lock(&local->client_call_lock);590591 list_del_init(&call->wait_link);592592+ spin_unlock(&local->client_call_lock);591593 return;592594 }593595
+1-1
net/sctp/sm_statefuns.c
···37513751 }3752375237533753 ch = (struct sctp_chunkhdr *)ch_end;37543754- } while (ch_end < skb_tail_pointer(skb));37543754+ } while (ch_end + sizeof(*ch) < skb_tail_pointer(skb));3755375537563756 if (ootb_shut_ack)37573757 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands);
···899899 struct ib_device *ibdev = smcibdev->ibdev;900900 struct net_device *ndev;901901902902- if (!ibdev->ops.get_netdev)903903- return;904904- ndev = ibdev->ops.get_netdev(ibdev, port + 1);902902+ ndev = ib_device_get_netdev(ibdev, port + 1);905903 if (ndev) {906904 smcibdev->ndev_ifidx[port] = ndev->ifindex;907905 dev_put(ndev);···919921 port_cnt = smcibdev->ibdev->phys_port_cnt;920922 for (i = 0; i < min_t(size_t, port_cnt, SMC_MAX_PORTS); i++) {921923 libdev = smcibdev->ibdev;922922- if (!libdev->ops.get_netdev)923923- continue;924924- lndev = libdev->ops.get_netdev(libdev, i + 1);924924+ lndev = ib_device_get_netdev(libdev, i + 1);925925 dev_put(lndev);926926 if (lndev != ndev)927927 continue;
+1-3
net/smc/smc_pnet.c
···10541054 for (i = 1; i <= SMC_MAX_PORTS; i++) {10551055 if (!rdma_is_port_valid(ibdev->ibdev, i))10561056 continue;10571057- if (!ibdev->ibdev->ops.get_netdev)10581058- continue;10591059- ndev = ibdev->ibdev->ops.get_netdev(ibdev->ibdev, i);10571057+ ndev = ib_device_get_netdev(ibdev->ibdev, i);10601058 if (!ndev)10611059 continue;10621060 dev_put(ndev);
···317317 int div;318318319319 div = DIV_ROUND_CLOSEST(input_rate, output_rate);320320- if (div > SAI_XCR1_MCKDIV_MAX(version)) {320320+ if (div > SAI_XCR1_MCKDIV_MAX(version) || div <= 0) {321321 dev_err(&sai->pdev->dev, "Divider %d out of range\n", div);322322 return -EINVAL;323323 }···378378 int div;379379380380 div = stm32_sai_get_clk_div(sai, *prate, rate);381381- if (div < 0)382382- return div;381381+ if (div <= 0)382382+ return -EINVAL;383383384384 mclk->freq = *prate / div;385385
+1-1
sound/soc/stm/stm32_spdifrx.c
···939939{940940 struct stm32_spdifrx_data *spdifrx = platform_get_drvdata(pdev);941941942942- if (spdifrx->ctrl_chan)942942+ if (!IS_ERR(spdifrx->ctrl_chan))943943 dma_release_channel(spdifrx->ctrl_chan);944944945945 if (spdifrx->dmab)
+1
sound/usb/mixer.c
···12051205 }12061206 break;12071207 case USB_ID(0x1bcf, 0x2283): /* NexiGo N930AF FHD Webcam */12081208+ case USB_ID(0x03f0, 0x654a): /* HP 320 FHD Webcam */12081209 if (!strcmp(kctl->id.name, "Mic Capture Volume")) {12091210 usb_audio_info(chip,12101211 "set resolution quirk: cval->res = 16\n");
···11+#!/bin/sh22+# SPDX-License-Identifier: GPL-2.033+# description: Test tracefs GID mount option44+# requires: "[gid=<gid>]":README55+66+fail() {77+ local msg="$1"88+99+ echo "FAILED: $msg"1010+ exit_fail1111+}1212+1313+find_alternate_gid() {1414+ local original_gid="$1"1515+ tac /etc/group | grep -v ":$original_gid:" | head -1 | cut -d: -f31616+}1717+1818+mount_tracefs_with_options() {1919+ local mount_point="$1"2020+ local options="$2"2121+2222+ mount -t tracefs -o "$options" nodev "$mount_point"2323+2424+ setup2525+}2626+2727+unmount_tracefs() {2828+ local mount_point="$1"2929+3030+ # Need to make sure the mount isn't busy so that we can umount it3131+ (cd $mount_point; finish_ftrace;)3232+3333+ cleanup3434+}3535+3636+create_instance() {3737+ local mount_point="$1"3838+ local instance="$mount_point/instances/$(mktemp -u test-XXXXXX)"3939+4040+ mkdir "$instance"4141+ echo "$instance"4242+}4343+4444+remove_instance() {4545+ local instance="$1"4646+4747+ rmdir "$instance"4848+}4949+5050+check_gid() {5151+ local mount_point="$1"5252+ local expected_gid="$2"5353+5454+ echo "Checking permission group ..."5555+5656+ cd "$mount_point"5757+5858+ for file in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable"; do5959+ local gid=`stat -c "%g" $file`6060+ if [ "$gid" -ne "$expected_gid" ]; then6161+ cd - # Return to the previous working directory (tracefs root)6262+ fail "$(realpath $file): Expected group $expected_gid; Got group $gid"6363+ fi6464+ done6565+6666+ cd - # Return to the previous working directory (tracefs root)6767+}6868+6969+test_gid_mount_option() {7070+ local mount_point=$(get_mount_point)7171+ local mount_options=$(get_mnt_options "$mount_point")7272+ local original_group=$(stat -c "%g" .)7373+ local other_group=$(find_alternate_gid "$original_group")7474+7575+ # Set up mount options with new GID for testing7676+ local new_options=`echo "$mount_options" | sed -e "s/gid=[0-9]*/gid=$other_group/"`7777+ if [ "$new_options" = "$mount_options" ]; then7878+ new_options="$mount_options,gid=$other_group"7979+ mount_options="$mount_options,gid=$original_group"8080+ fi8181+8282+ # Unmount existing tracefs instance and mount with new GID8383+ unmount_tracefs "$mount_point"8484+ mount_tracefs_with_options "$mount_point" "$new_options"8585+8686+ check_gid "$mount_point" "$other_group"8787+8888+ # Check that files created after the mount inherit the GID8989+ local instance=$(create_instance "$mount_point")9090+ check_gid "$instance" "$other_group"9191+ remove_instance "$instance"9292+9393+ # Unmount and remount with the original GID9494+ unmount_tracefs "$mount_point"9595+ mount_tracefs_with_options "$mount_point" "$mount_options"9696+ check_gid "$mount_point" "$original_group"9797+}9898+9999+test_gid_mount_option100100+101101+exit 0
···11#!/bin/sh22# SPDX-License-Identifier: GPL-2.033# description: Test file and directory ownership changes for eventfs44+# requires: "[gid=<gid>]":README4556original_group=`stat -c "%g" .`67original_owner=`stat -c "%u" .`7888-mount_point=`stat -c '%m' .`99+local mount_point=$(get_mount_point)9101010-# If stat -c '%m' does not work (e.g. busybox) or failed, try to use the1111-# current working directory (which should be a tracefs) as the mount point.1212-if [ ! -d "$mount_point" ]; then1313- if mount | grep -qw $PWD ; then1414- mount_point=$PWD1515- else1616- # If PWD doesn't work, that is an environmental problem.1717- exit_unresolved1818- fi1919-fi2020-2121-mount_options=`mount | grep "$mount_point" | sed -e 's/.*(\(.*\)).*/\1/'`1111+mount_options=$(get_mnt_options "$mount_point")22122313# find another owner and group that is not the original2414other_group=`tac /etc/group | grep -v ":$original_group:" | head -1 | cut -d: -f3`
+25
tools/testing/selftests/ftrace/test.d/functions
···193193 # " Command: " and "^\n" => 13194194 test $(expr 13 + $pos) -eq $N195195}196196+197197+# Helper to get the tracefs mount point198198+get_mount_point() {199199+ local mount_point=`stat -c '%m' .`200200+201201+ # If stat -c '%m' does not work (e.g. busybox) or failed, try to use the202202+ # current working directory (which should be a tracefs) as the mount point.203203+ if [ ! -d "$mount_point" ]; then204204+ if mount | grep -qw "$PWD"; then205205+ mount_point=$PWD206206+ else207207+ # If PWD doesn't work, that is an environmental problem.208208+ exit_unresolved209209+ fi210210+ fi211211+ echo "$mount_point"212212+}213213+214214+# Helper function to retrieve mount options for a given mount point215215+get_mnt_options() {216216+ local mnt_point="$1"217217+ local opts=$(mount | grep -m1 "$mnt_point" | sed -e 's/.*(\(.*\)).*/\1/')218218+219219+ echo "$opts"220220+}
+12-7
tools/testing/selftests/mm/hugetlb_dio.c
···4444 if (fd < 0)4545 ksft_exit_fail_perror("Error opening file\n");46464747- /* Get the free huge pages before allocation */4848- free_hpage_b = get_free_hugepages();4949- if (free_hpage_b == 0) {5050- close(fd);5151- ksft_exit_skip("No free hugepage, exiting!\n");5252- }5353-5447 /* Allocate a hugetlb page */5548 orig_buffer = mmap(NULL, h_pagesize, mmap_prot, mmap_flags, -1, 0);5649 if (orig_buffer == MAP_FAILED) {···8794int main(void)8895{8996 size_t pagesize = 0;9797+ int fd;90989199 ksft_print_header();100100+101101+ /* Open the file to DIO */102102+ fd = open("/tmp", O_TMPFILE | O_RDWR | O_DIRECT, 0664);103103+ if (fd < 0)104104+ ksft_exit_skip("Unable to allocate file: %s\n", strerror(errno));105105+ close(fd);106106+107107+ /* Check if huge pages are free */108108+ if (!get_free_hugepages())109109+ ksft_exit_skip("No free hugepage, exiting\n");110110+92111 ksft_set_plan(4);9311294113 /* Get base page size */