Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge 4.14.189 into neutrino-msm-hotdogb-4.14
Browse files Browse the repository at this point in the history
Changes in 4.14.189: (126 commits)
  KVM: s390: reduce number of IO pins to 1
  spi: spi-fsl-dspi: Adding shutdown hook
  spi: spi-fsl-dspi: Fix lockup if device is removed during SPI transfer
  spi: spi-fsl-dspi: use IRQF_SHARED mode to request IRQ
  spi: spi-fsl-dspi: Fix external abort on interrupt in resume or exit paths
  ARM: dts: omap4-droid4: Fix spi configuration and increase rate
  gpu: host1x: Detach driver on unregister
  spi: spidev: fix a race between spidev_release and spidev_remove
  spi: spidev: fix a potential use-after-free in spidev_release()
  ixgbe: protect ring accesses with READ- and WRITE_ONCE
  s390/kasan: fix early pgm check handler execution
  cifs: update ctime and mtime during truncate
  ARM: imx6: add missing put_device() call in imx6q_suspend_init()
  scsi: mptscsih: Fix read sense data size
  nvme-rdma: assign completion vector correctly
  x86/entry: Increase entry_stack size to a full page
  net: cxgb4: fix return error value in t4_prep_fw
  smsc95xx: check return value of smsc95xx_reset
  smsc95xx: avoid memory leak in smsc95xx_bind
  ALSA: compress: fix partial_drain completion state
  arm64: kgdb: Fix single-step exception handling oops
  nbd: Fix memory leak in nbd_add_socket
  bnxt_en: fix NULL dereference in case SR-IOV configuration fails
  net: macb: mark device wake capable when "magic-packet" property present
  mlxsw: spectrum_router: Remove inappropriate usage of WARN_ON()
  ALSA: opl3: fix infoleak in opl3
  ALSA: hda - let hs_mic be picked ahead of hp_mic
  ALSA: usb-audio: add quirk for MacroSilicon MS2109
  KVM: arm64: Fix definition of PAGE_HYP_DEVICE
  KVM: arm64: Stop clobbering x0 for HVC_SOFT_RESTART
  KVM: x86: bit 8 of non-leaf PDPEs is not reserved
  KVM: x86: Inject #GP if guest attempts to toggle CR4.LA57 in 64-bit mode
  KVM: x86: Mark CR4.TSD as being possibly owned by the guest
  Revert "ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb"
  btrfs: fix fatal extent_buffer readahead vs releasepage race
  drm/radeon: fix double free
  dm: use noio when sending kobject event
  ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE
  ARC: elf: use right ELF_ARCH
  s390/mm: fix huge pte soft dirty copying
  genetlink: remove genl_bind
  ipv4: fill fl4_icmp_{type,code} in ping_v4_sendmsg
  l2tp: remove skb_dst_set() from l2tp_xmit_skb()
  llc: make sure applications use ARPHRD_ETHER
  net: Added pointer check for dst->ops->neigh_lookup in dst_neigh_lookup_skb
  net: usb: qmi_wwan: add support for Quectel EG95 LTE modem
  tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()
  tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers
  tcp: md5: allow changing MD5 keys in all socket states
  net_sched: fix a memory leak in atm_tc_init()
  tcp: make sure listeners don't initialize congestion-control state
  tcp: md5: do not send silly options in SYNCOOKIES
  cgroup: fix cgroup_sk_alloc() for sk_clone_lock()
  cgroup: Fix sock_cgroup_data on big-endian.
  drm/exynos: fix ref count leak in mic_pre_enable
  arm64/alternatives: use subsections for replacement sequences
  tpm_tis: extra chip->ops check on error path in tpm_tis_core_init
  gfs2: read-only mounts should grab the sd_freeze_gl glock
  i2c: eg20t: Load module automatically if ID matches
  arm64: alternative: Use true and false for boolean values
  arm64/alternatives: don't patch up internal branches
  iio:magnetometer:ak8974: Fix alignment and data leak issues
  iio:humidity:hdc100x Fix alignment and data leak issues
  iio: magnetometer: ak8974: Fix runtime PM imbalance on error
  iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe()
  iio: pressure: zpa2326: handle pm_runtime_get_sync failure
  iio:pressure:ms5611 Fix buffer element alignment
  iio:health:afe4403 Fix timestamp alignment and prevent data leak.
  spi: spi-fsl-dspi: Fix lockup if device is shutdown during SPI transfer
  spi: fix initial SPI_SR value in spi-fsl-dspi
  net: dsa: bcm_sf2: Fix node reference count
  of: of_mdio: Correct loop scanning logic
  Revert "usb/ohci-platform: Fix a warning when hibernating"
  Revert "usb/ehci-platform: Set PM runtime as active on resume"
  Revert "usb/xhci-plat: Set PM runtime as active on resume"
  doc: dt: bindings: usb: dwc3: Update entries for disabling SS instances in park mode
  mmc: sdhci: do not enable card detect interrupt for gpio cd type
  ACPI: video: Use native backlight on Acer Aspire 5783z
  ACPI: video: Use native backlight on Acer TravelMate 5735Z
  iio:health:afe4404 Fix timestamp alignment and prevent data leak.
  phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked
  arm64: dts: meson: add missing gxl rng clock
  spi: spi-sun6i: sun6i_spi_transfer_one(): fix setting of clock rate
  usb: gadget: udc: atmel: fix uninitialized read in debug printk
  staging: comedi: verify array index is correct before using it
  Revert "thermal: mediatek: fix register index error"
  ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema
  copy_xstate_to_kernel: Fix typo which caused GDB regression
  perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode
  mtd: rawnand: brcmnand: fix CS0 layout
  mtd: rawnand: oxnas: Keep track of registered devices
  mtd: rawnand: oxnas: Unregister all devices on error
  mtd: rawnand: oxnas: Release all devices in the _remove() path
  HID: magicmouse: do not set up autorepeat
  ALSA: line6: Perform sanity check for each URB creation
  ALSA: usb-audio: Fix race against the error recovery URB submission
  USB: c67x00: fix use after free in c67x00_giveback_urb
  usb: dwc2: Fix shutdown callback in platform
  usb: chipidea: core: add wakeup support for extcon
  usb: gadget: function: fix missing spinlock in f_uac1_legacy
  USB: serial: iuu_phoenix: fix memory corruption
  USB: serial: cypress_m8: enable Simply Automated UPB PIM
  USB: serial: ch341: add new Product ID for CH340
  USB: serial: option: add GosunCn GM500 series
  USB: serial: option: add Quectel EG95 LTE modem
  virtio: virtio_console: add missing MODULE_DEVICE_TABLE() for rproc serial
  fuse: Fix parameter for FS_IOC_{GET,SET}FLAGS
  Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()"
  mei: bus: don't clean driver pointer
  Input: i8042 - add Lenovo XiaoXin Air 12 to i8042 nomux list
  uio_pdrv_genirq: fix use without device tree and no interrupt
  timer: Fix wheel index calculation on last level
  MIPS: Fix build for LTS kernel caused by backporting lpj adjustment
  hwmon: (emc2103) fix unable to change fan pwm1_enable attribute
  intel_th: pci: Add Jasper Lake CPU support
  intel_th: pci: Add Tiger Lake PCH-H support
  intel_th: pci: Add Emmitsburg PCH support
  dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler
  misc: atmel-ssc: lock with mutex instead of spinlock
  thermal/drivers/cpufreq_cooling: Fix wrong frequency converted from power
  arm64: ptrace: Override SPSR.SS when single-stepping is enabled
  sched/fair: handle case of task_h_load() returning 0
  x86/cpu: Move x86_cache_bits settings
  libceph: don't omit recovery_deletes in target_copy()
  rxrpc: Fix trace string
  Linux 4.14.189

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>

Conflicts:
	arch/arm64/kernel/vmlinux.lds.S
	drivers/usb/host/xhci-plat.c
	net/netlink/genetlink.c
	sound/core/compress_offload.c
  • Loading branch information
0ctobot committed Jul 23, 2020
2 parents 5b36610 + 69b94dd commit 1948bc1
Show file tree
Hide file tree
Showing 122 changed files with 684 additions and 397 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/usb/dwc3.txt
Expand Up @@ -48,6 +48,8 @@ Optional properties:
from P0 to P1/P2/P3 without delay.
- snps,dis-tx-ipgap-linecheck-quirk: when set, disable u2mac linestate check
during HS transmit.
- snps,parkmode-disable-ss-quirk: when set, all SuperSpeed bus instances in
park mode are disabled.
- snps,dis_metastability_quirk: when set, disable metastability workaround.
CAUTION: use only if you are absolutely sure of it.
- snps,ssp-u3-u0-quirk: when set, core always changes PHY power state
Expand Down
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 188
SUBLEVEL = 189
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
2 changes: 1 addition & 1 deletion arch/arc/include/asm/elf.h
Expand Up @@ -26,7 +26,7 @@
#define R_ARC_32_PCREL 0x31

/*to set parameters in the core dumps */
#define ELF_ARCH EM_ARCOMPACT
#define ELF_ARCH EM_ARC_INUSE
#define ELF_CLASS ELFCLASS32

#ifdef CONFIG_CPU_BIG_ENDIAN
Expand Down
16 changes: 5 additions & 11 deletions arch/arc/kernel/entry.S
Expand Up @@ -156,7 +156,6 @@ END(EV_Extension)
tracesys:
; save EFA in case tracer wants the PC of traced task
; using ERET won't work since next-PC has already committed
lr r12, [efa]
GET_CURR_TASK_FIELD_PTR TASK_THREAD, r11
st r12, [r11, THREAD_FAULT_ADDR] ; thread.fault_address

Expand Down Expand Up @@ -199,15 +198,9 @@ tracesys_exit:
; Breakpoint TRAP
; ---------------------------------------------
trap_with_param:

; stop_pc info by gdb needs this info
lr r0, [efa]
mov r0, r12 ; EFA in case ptracer/gdb wants stop_pc
mov r1, sp

; Now that we have read EFA, it is safe to do "fake" rtie
; and get out of CPU exception mode
FAKE_RET_FROM_EXCPN

; Save callee regs in case gdb wants to have a look
; SP will grow up by size of CALLEE Reg-File
; NOTE: clobbers r12
Expand All @@ -234,16 +227,17 @@ ENTRY(EV_Trap)

EXCEPTION_PROLOGUE

lr r12, [efa]

FAKE_RET_FROM_EXCPN

;============ TRAP 1 :breakpoints
; Check ECR for trap with arg (PROLOGUE ensures r9 has ECR)
bmsk.f 0, r9, 7
bnz trap_with_param

;============ TRAP (no param): syscall top level

; First return from Exception to pure K mode (Exception/IRQs renabled)
FAKE_RET_FROM_EXCPN

; If syscall tracing ongoing, invoke pre-post-hooks
GET_CURR_THR_INFO_FLAGS r10
btst r10, TIF_SYSCALL_TRACE
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
Expand Up @@ -16,8 +16,10 @@
#interrupt-cells = <2>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <3000000>;
spi-max-frequency = <9600000>;
spi-cs-high;
spi-cpol;
spi-cpha;

cpcap_adc: adc {
compatible = "motorola,mapphone-cpcap-adc";
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/socfpga.dtsi
Expand Up @@ -706,7 +706,7 @@
};
};

L2: l2-cache@fffef000 {
L2: cache-controller@fffef000 {
compatible = "arm,pl310-cache";
reg = <0xfffef000 0x1000>;
interrupts = <0 38 0x04>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/socfpga_arria10.dtsi
Expand Up @@ -606,7 +606,7 @@
reg = <0xffcfb100 0x80>;
};

L2: l2-cache@fffff000 {
L2: cache-controller@fffff000 {
compatible = "arm,pl310-cache";
reg = <0xfffff000 0x1000>;
interrupts = <0 18 IRQ_TYPE_LEVEL_HIGH>;
Expand Down
10 changes: 6 additions & 4 deletions arch/arm/mach-imx/pm-imx6.c
Expand Up @@ -483,14 +483,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
if (!ocram_pool) {
pr_warn("%s: ocram pool unavailable!\n", __func__);
ret = -ENODEV;
goto put_node;
goto put_device;
}

ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
if (!ocram_base) {
pr_warn("%s: unable to alloc ocram!\n", __func__);
ret = -ENOMEM;
goto put_node;
goto put_device;
}

ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
Expand All @@ -513,7 +513,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
if (ret) {
pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
goto put_node;
goto put_device;
}

ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
Expand Down Expand Up @@ -560,7 +560,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
&imx6_suspend,
MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));

goto put_node;
goto put_device;

pl310_cache_map_failed:
iounmap(pm_info->gpc_base.vbase);
Expand All @@ -570,6 +570,8 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
iounmap(pm_info->src_base.vbase);
src_map_failed:
iounmap(pm_info->mmdc_base.vbase);
put_device:
put_device(&pdev->dev);
put_node:
of_node_put(node);

Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
Expand Up @@ -245,6 +245,11 @@
};
};

&hwrng {
clocks = <&clkc CLKID_RNG0>;
clock-names = "core";
};

&i2c_A {
clocks = <&clkc CLKID_I2C>;
};
Expand Down
16 changes: 8 additions & 8 deletions arch/arm64/include/asm/alternative.h
Expand Up @@ -68,11 +68,11 @@ void apply_alternatives(void *start, size_t length);
".pushsection .altinstructions,\"a\"\n" \
ALTINSTR_ENTRY(feature) \
".popsection\n" \
".pushsection .altinstr_replacement, \"a\"\n" \
".subsection 1\n" \
"663:\n\t" \
newinstr "\n" \
"664:\n\t" \
".popsection\n\t" \
".previous\n\t" \
".org . - (664b-663b) + (662b-661b)\n\t" \
".org . - (662b-661b) + (664b-663b)\n" \
".endif\n"
Expand Down Expand Up @@ -112,9 +112,9 @@ void apply_alternatives(void *start, size_t length);
662: .pushsection .altinstructions, "a"
altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f
.popsection
.pushsection .altinstr_replacement, "ax"
.subsection 1
663: \insn2
664: .popsection
664: .previous
.org . - (664b-663b) + (662b-661b)
.org . - (662b-661b) + (664b-663b)
.endif
Expand Down Expand Up @@ -155,7 +155,7 @@ void apply_alternatives(void *start, size_t length);
.pushsection .altinstructions, "a"
altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f
.popsection
.pushsection .altinstr_replacement, "ax"
.subsection 1
.align 2 /* So GAS knows label 661 is suitably aligned */
661:
.endm
Expand All @@ -174,9 +174,9 @@ void apply_alternatives(void *start, size_t length);
.macro alternative_else
662:
.if .Lasm_alt_mode==0
.pushsection .altinstr_replacement, "ax"
.subsection 1
.else
.popsection
.previous
.endif
663:
.endm
Expand All @@ -187,7 +187,7 @@ void apply_alternatives(void *start, size_t length);
.macro alternative_endif
664:
.if .Lasm_alt_mode==0
.popsection
.previous
.endif
.org . - (664b-663b) + (662b-661b)
.org . - (662b-661b) + (664b-663b)
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/include/asm/debug-monitors.h
Expand Up @@ -126,6 +126,8 @@ void disable_debug_monitors(enum dbg_active_el el);

void user_rewind_single_step(struct task_struct *task);
void user_fastforward_single_step(struct task_struct *task);
void user_regs_reset_single_step(struct user_pt_regs *regs,
struct task_struct *task);

void kernel_enable_single_step(struct pt_regs *regs);
void kernel_disable_single_step(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/include/asm/pgtable-prot.h
Expand Up @@ -65,7 +65,7 @@
#define PAGE_HYP __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
#define PAGE_HYP_EXEC __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
#define PAGE_HYP_RO __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
#define PAGE_HYP_DEVICE __pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
#define PAGE_HYP_DEVICE __pgprot(_PROT_DEFAULT | PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_HYP | PTE_HYP_XN)

#define PAGE_S2 __pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
#define PAGE_S2_DEVICE __pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
Expand Down
16 changes: 2 additions & 14 deletions arch/arm64/kernel/alternative.c
Expand Up @@ -44,20 +44,8 @@ struct alt_region {
*/
static bool branch_insn_requires_update(struct alt_instr *alt, unsigned long pc)
{
unsigned long replptr;

if (kernel_text_address(pc))
return 1;

replptr = (unsigned long)ALT_REPL_PTR(alt);
if (pc >= replptr && pc <= (replptr + alt->alt_len))
return 0;

/*
* Branching into *another* alternate sequence is doomed, and
* we're not even trying to fix it up.
*/
BUG();
unsigned long replptr = (unsigned long)ALT_REPL_PTR(alt);
return !(pc >= replptr && pc <= (replptr + alt->alt_len));
}

#define align_down(x, a) ((unsigned long)(x) & ~(((unsigned long)(a)) - 1))
Expand Down
20 changes: 16 additions & 4 deletions arch/arm64/kernel/debug-monitors.c
Expand Up @@ -150,17 +150,20 @@ postcore_initcall(debug_monitors_init);
/*
* Single step API and exception handling.
*/
static void set_regs_spsr_ss(struct pt_regs *regs)
static void set_user_regs_spsr_ss(struct user_pt_regs *regs)
{
regs->pstate |= DBG_SPSR_SS;
}
NOKPROBE_SYMBOL(set_regs_spsr_ss);
NOKPROBE_SYMBOL(set_user_regs_spsr_ss);

static void clear_regs_spsr_ss(struct pt_regs *regs)
static void clear_user_regs_spsr_ss(struct user_pt_regs *regs)
{
regs->pstate &= ~DBG_SPSR_SS;
}
NOKPROBE_SYMBOL(clear_regs_spsr_ss);
NOKPROBE_SYMBOL(clear_user_regs_spsr_ss);

#define set_regs_spsr_ss(r) set_user_regs_spsr_ss(&(r)->user_regs)
#define clear_regs_spsr_ss(r) clear_user_regs_spsr_ss(&(r)->user_regs)

static DEFINE_SPINLOCK(debug_hook_lock);
static LIST_HEAD(user_step_hook);
Expand Down Expand Up @@ -432,6 +435,15 @@ void user_fastforward_single_step(struct task_struct *task)
clear_regs_spsr_ss(task_pt_regs(task));
}

void user_regs_reset_single_step(struct user_pt_regs *regs,
struct task_struct *task)
{
if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
set_user_regs_spsr_ss(regs);
else
clear_user_regs_spsr_ss(regs);
}

/* Kernel API */
void kernel_enable_single_step(struct pt_regs *regs)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/kgdb.c
Expand Up @@ -258,7 +258,7 @@ static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr)
if (user_mode(regs) || !kgdb_single_step)
return DBG_HOOK_ERROR;

kgdb_handle_exception(1, SIGTRAP, 0, regs);
kgdb_handle_exception(0, SIGTRAP, 0, regs);
return DBG_HOOK_HANDLED;
}
NOKPROBE_SYMBOL(kgdb_step_brk_fn);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/kernel/ptrace.c
Expand Up @@ -1496,8 +1496,8 @@ static int valid_native_regs(struct user_pt_regs *regs)
*/
int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task)
{
if (!test_tsk_thread_flag(task, TIF_SINGLESTEP))
regs->pstate &= ~DBG_SPSR_SS;
/* https://lore.kernel.org/lkml/20191118131525.GA4180@willie-the-truck */
user_regs_reset_single_step(regs, task);

if (is_compat_thread(task_thread_info(task)))
return valid_compat_regs(regs);
Expand Down
3 changes: 0 additions & 3 deletions arch/arm64/kernel/vmlinux.lds.S
Expand Up @@ -154,9 +154,6 @@ SECTIONS
KEEP(*(.altinstructions))
__alt_instructions_end = .;
}
.altinstr_replacement : {
KEEP(*(.altinstr_replacement))
}

. = ALIGN(PAGE_SIZE);
__inittext_end = .;
Expand Down
11 changes: 7 additions & 4 deletions arch/arm64/kvm/hyp-init.S
Expand Up @@ -147,11 +147,15 @@ ENTRY(__kvm_handle_stub_hvc)

1: cmp x0, #HVC_RESET_VECTORS
b.ne 1f
reset:

/*
* Reset kvm back to the hyp stub. Do not clobber x0-x4 in
* case we coming via HVC_SOFT_RESTART.
* Set the HVC_RESET_VECTORS return code before entering the common
* path so that we do not clobber x0-x2 in case we are coming via
* HVC_SOFT_RESTART.
*/
mov x0, xzr
reset:
/* Reset kvm back to the hyp stub. */
mrs x5, sctlr_el2
ldr x6, =SCTLR_ELx_FLAGS
bic x5, x5, x6 // Clear SCTL_M and etc
Expand All @@ -162,7 +166,6 @@ reset:
/* Install stub vectors */
adr_l x5, __hyp_stub_vectors
msr vbar_el2, x5
mov x0, xzr
eret

1: /* Bad stub call */
Expand Down
13 changes: 4 additions & 9 deletions arch/mips/kernel/time.c
Expand Up @@ -40,10 +40,8 @@ static unsigned long glb_lpj_ref_freq;
static int cpufreq_callback(struct notifier_block *nb,
unsigned long val, void *data)
{
struct cpufreq_freqs *freq = data;
struct cpumask *cpus = freq->policy->cpus;
unsigned long lpj;
int cpu;
struct cpufreq_freqs *freq = data;

/*
* Skip lpj numbers adjustment if the CPU-freq transition is safe for
Expand All @@ -64,6 +62,7 @@ static int cpufreq_callback(struct notifier_block *nb,
}
}

cpu = freq->cpu;
/*
* Adjust global lpj variable and per-CPU udelay_val number in
* accordance with the new CPU frequency.
Expand All @@ -74,12 +73,8 @@ static int cpufreq_callback(struct notifier_block *nb,
glb_lpj_ref_freq,
freq->new);

for_each_cpu(cpu, cpus) {
lpj = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
per_cpu(pcp_lpj_ref_freq, cpu),
freq->new);
cpu_data[cpu].udelay_val = (unsigned int)lpj;
}
cpu_data[cpu].udelay_val = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
per_cpu(pcp_lpj_ref_freq, cpu), freq->new);
}

return NOTIFY_OK;
Expand Down

0 comments on commit 1948bc1

Please sign in to comment.