static int param_set_osttrace_nb(const char *val, const struct kernel_param *kp) { t_ee_state *state; int coreId, rv; u32 oldSize; for (coreId = FIRST_MPC_ID; coreId <= LAST_MPC_ID; coreId++) { state = cm_EEM_getExecutiveEngine(coreId); if (&(state->traceBufferSize) == kp->arg) break; } oldSize = state->traceBufferSize; rv = param_set_uint(val, kp); if (rv) return rv; if (CM_ENGINE_resizeTraceBuffer(coreId, oldSize) == CM_OK) { pr_info("[CM]: OST Trace buffer resizing done successfully " "for %s DSP\n", osalEnv.mpc[COREIDX(coreId)].name); return 0; } else { return -EINVAL; } }
static int camera_boost_set(const char *arg, const struct kernel_param *kp) { int ret = param_set_uint(arg, kp); if (ret) return ret; pr_info("camera_boost=%d\n", camera_boost); return 0; }
/************************************************************* * EPOLL2-specific code *************************************************************/ static int set_max_stacks(const char *val, struct kernel_param *kp) { int rc = param_set_uint(val, kp); if( rc != 0 ) return rc; /* do not accept 0 value: use default instead */ if( epoll_max_stacks == 0 ) epoll_max_stacks = CI_CFG_EPOLL_MAX_STACKS; return 0; }
static int set_policy(const char *val, const struct kernel_param *kp) { int ret; ret = param_set_uint(val, kp); if (ret < 0) return ret; rockchip_pm_set_policy(policy); policy = rockchip_pm_get_policy(); return 0; }
static int set_debug(const char *val, struct kernel_param *kp) { int ret; struct sfax_hw *card; ret = param_set_uint(val, kp); if (!ret) { read_lock(&card_lock); list_for_each_entry(card, &Cards, list) _set_debug(card); read_unlock(&card_lock); } return ret; }
static int mtu_max_set(const char *val, const struct kernel_param *kp) { int ret; /* sets mtu_max directly. no need to restore it in case of * illegal value since we assume this will fail insmod */ ret = param_set_uint(val, kp); if (ret) return ret; if (mtu_max < 68 || mtu_max > WIL_MAX_ETH_MTU) ret = -EINVAL; return ret; }
static int set_enable_mask(const char *val, const struct kernel_param *kp) { int rv = param_set_uint(val, kp); unsigned long flags; if (rv) return rv; spin_lock_irqsave(&enable_mask_lock, flags); if (!(enable_mask & ENABLE_C2)) { unsigned int cpuid = smp_processor_id(); int i; for_each_online_cpu(i) { if (i == cpuid) continue; arm_send_ping_ipi(i); } }
static int set_enable_mask(const char *val, const struct kernel_param *kp) { int rv = param_set_uint(val, kp); unsigned long flags; pr_info("%s: val=%s, enable_maks=%d\n", __func__, val, enable_mask); if (rv) return rv; spin_lock_irqsave(&enable_mask_lock, flags); if (!(enable_mask & ENABLE_C2)) { unsigned int cpuid = smp_processor_id(); int i; for_each_online_cpu(i) { if (i == cpuid) continue; arch_send_wakeup_ipi_mask(cpumask_of(i)); } }
static int set_enable_mask(const char *val, const struct kernel_param *kp) { int rv = param_set_uint(val, kp); unsigned long flags; pr_info("%s: enable_mask=0x%x\n", __func__, enable_mask); if (rv) return rv; spin_lock_irqsave(&enable_mask_lock, flags); if (!(enable_mask & ENABLE_C2)) { unsigned int cpuid = smp_processor_id(); int i; for_each_online_cpu(i) { if (i == cpuid) continue; smp_send_reschedule(i); } }
static int ddr_health_set(const char *val, struct kernel_param *kp) { int ret; void *virt; uint64_t old_addr = 0; uint32_t old_size = 0; mutex_lock(&lock); ret = param_set_uint(val, kp); if (ret) { pr_err("ddr-health: error setting value %d\n", ret); mutex_unlock(&lock); return ret; } if (rpm_kvp.data) { ddr_health = (struct ddr_health *)rpm_kvp.data; old_addr = ddr_health->addr; old_size = ddr_health->size; } rpm_kvp.key = RPM_MISC_REQ_DDR_HEALTH; if (mem_size) { virt = kzalloc(mem_size, GFP_KERNEL); if (!virt) { pr_err("ddr-health: failed to alloc mem request %x\n", mem_size); mutex_unlock(&lock); return -ENOMEM; } ddr_health->addr = (uint64_t)virt_to_phys(virt); ddr_health->size = mem_size; rpm_kvp.length = sizeof(struct ddr_health); rpm_kvp.data = (void *)ddr_health; ret = msm_rpm_send_message(MSM_RPM_CTX_ACTIVE_SET, RPM_MISC_REQ_TYPE, 0, &rpm_kvp, 1); if (ret) { pr_err("ddr-health: send buf to RPM failed %d, %x\n", ret, mem_size); kfree(virt); goto err; } } else { ddr_health->addr = 0; ddr_health->size = 0; rpm_kvp.length = sizeof(struct ddr_health); rpm_kvp.data = (void *)ddr_health; ret = msm_rpm_send_message(MSM_RPM_CTX_ACTIVE_SET, RPM_MISC_REQ_TYPE, 0, &rpm_kvp, 1); if (ret) { pr_err("ddr-health: send nobuf to RPM failed %d, %x\n", ret, mem_size); goto err; } } if (old_addr) kfree(phys_to_virt((phys_addr_t)old_addr)); mutex_unlock(&lock); return 0; err: ddr_health->addr = old_addr; ddr_health->size = old_size; mutex_unlock(&lock); return ret; }