summaryrefslogtreecommitdiff
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorSrinivasarao P <spathi@codeaurora.org>2018-01-09 16:10:13 +0530
committerSrinivasarao P <spathi@codeaurora.org>2018-01-18 12:50:06 +0530
commit3726391f0570b5c8889d1db5f02a6a0a622c65b2 (patch)
treec1c8da9447d46a22126ee5e8172cbfeda6847c46 /drivers/cpuidle
parent2d309c994df3624f59114edea6c03dd7cf3f334d (diff)
parent55b3b8c2b57468ab16c2b04778074fe52406a03c (diff)
Merge android-4.4.108 (55b3b8c) into msm-4.4
* refs/heads/tmp-55b3b8c Linux 4.4.108 alpha: fix build failures ALSA: hda - Fix yet another i915 pointer leftover in error path ALSA: hda - Degrade i915 binding failure message ALSA: hda - Clear the leftover component assignment at snd_hdac_i915_exit() Revert "Bluetooth: btusb: driver to enable the usb-wakeup feature" MIPS: math-emu: Fix final emulation phase for certain instructions thermal: hisilicon: Handle return value of clk_prepare_enable cpuidle: fix broadcast control when broadcast can not be entered rtc: set the alarm to the next expiring timer tcp: fix under-evaluated ssthresh in TCP Vegas fm10k: ensure we process SM mbx when processing VF mbx scsi: lpfc: PLOGI failures during NPIV testing scsi: lpfc: Fix secure firmware updates PCI/AER: Report non-fatal errors only to the affected endpoint ixgbe: fix use of uninitialized padding igb: check memory allocation failure PCI: Create SR-IOV virtfn/physfn links before attaching driver scsi: mpt3sas: Fix IO error occurs on pulling out a drive from RAID1 volume created on two SATA drive scsi: cxgb4i: fix Tx skb leak PCI: Avoid bus reset if bridge itself is broken net: phy: at803x: Change error to EINVAL for invalid MAC rtc: pl031: make interrupt optional crypto: crypto4xx - increase context and scatter ring buffer elements backlight: pwm_bl: Fix overflow condition bnxt_en: Fix NULL pointer dereference in reopen failure path cpuidle: powernv: Pass correct drv->cpumask for registration ARM: dma-mapping: disallow dma_get_sgtable() for non-kernel managed memory netfilter: nfnetlink_queue: fix secctx memory leak xhci: plat: Register shutdown for xhci_plat isdn: kcapi: avoid uninitialized data KVM: pci-assign: do not map smm memory slot pages in vt-d page tables ARM: dts: am335x-evmsk: adjust mmc2 param to allow suspend netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register netfilter: nfnl_cthelper: fix a race when walk the nf_ct_helper_hash table irda: vlsi_ir: fix check for DMA mapping errors RDMA/iser: Fix possible mr leak on device removal event i40e: Do not enable NAPI on q_vectors that have no rings net: Do not allow negative values for busy_read and busy_poll sysctl interfaces bna: avoid writing uninitialized data into hw registers s390/qeth: no ETH header for outbound AF_IUCV r8152: prevent the driver from transmitting packets with carrier off HID: xinmo: fix for out of range for THT 2P arcade controller. hwmon: (asus_atk0110) fix uninitialized data access ARM: dts: ti: fix PCI bus dtc warnings KVM: VMX: Fix enable VPID conditions KVM: x86: correct async page present tracepoint scsi: lpfc: Fix PT2PT PRLI reject pinctrl: st: add irq_request/release_resources callbacks inet: frag: release spinlock before calling icmp_send() netfilter: nfnl_cthelper: Fix memory leak netfilter: nfnl_cthelper: fix runtime expectation policy updates usb: gadget: udc: remove pointer dereference after free usb: gadget: f_uvc: Sanity check wMaxPacketSize for SuperSpeed net: qmi_wwan: Add USB IDs for MDM6600 modem on Motorola Droid 4 bna: integer overflow bug in debugfs sch_dsmark: fix invalid skb_cow() usage crypto: deadlock between crypto_alg_sem/rtnl_mutex/genl_mutex r8152: fix the list rx_done may be used without initialization cpuidle: Validate cpu_dev in cpuidle_add_sysfs() arm: kprobes: Align stack to 8-bytes in test code arm: kprobes: Fix the return address of multiple kretprobes ALSA: hda - add support for docking station for HP 840 G3 ALSA: hda - add support for docking station for HP 820 G2 x86/irq: Do not substract irq_tlb_count from irq_call_count sched/core: Idle_task_exit() shouldn't use switch_mm_irqs_off() ARM: Hide finish_arch_post_lock_switch() from modules x86/mm, sched/core: Turn off IRQs in switch_mm() x86/mm, sched/core: Uninline switch_mm() x86/mm: Build arch/x86/mm/tlb.c even on !SMP sched/core: Add switch_mm_irqs_off() and use it in the scheduler mm/mmu_context, sched/core: Fix mmu_context.h assumption mm/rmap: batched invalidations should use existing api x86/mm: If INVPCID is available, use it to flush global mappings x86/mm: Add a 'noinvpcid' boot option to turn off INVPCID x86/mm: Fix INVPCID asm constraint x86/mm: Add INVPCID helpers cxl: Check if vphb exists before iterating over AFU devices arm64: Initialise high_memory global variable earlier ANDROID: binder: Remove obsolete proc waitqueue. Change-Id: Ie954ccd1dbd861672345bb0ee879273be4d0a441 Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle-powernv.c18
-rw-r--r--drivers/cpuidle/cpuidle.c1
-rw-r--r--drivers/cpuidle/sysfs.c12
3 files changed, 31 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
index 845bafcfa792..d5c5a476360f 100644
--- a/drivers/cpuidle/cpuidle-powernv.c
+++ b/drivers/cpuidle/cpuidle-powernv.c
@@ -160,6 +160,24 @@ static int powernv_cpuidle_driver_init(void)
drv->state_count += 1;
}
+ /*
+ * On the PowerNV platform cpu_present may be less than cpu_possible in
+ * cases when firmware detects the CPU, but it is not available to the
+ * OS. If CONFIG_HOTPLUG_CPU=n, then such CPUs are not hotplugable at
+ * run time and hence cpu_devices are not created for those CPUs by the
+ * generic topology_init().
+ *
+ * drv->cpumask defaults to cpu_possible_mask in
+ * __cpuidle_driver_init(). This breaks cpuidle on PowerNV where
+ * cpu_devices are not created for CPUs in cpu_possible_mask that
+ * cannot be hot-added later at run time.
+ *
+ * Trying cpuidle_register_device() on a CPU without a cpu_device is
+ * incorrect, so pass a correct CPU mask to the generic cpuidle driver.
+ */
+
+ drv->cpumask = (struct cpumask *)cpu_present_mask;
+
return 0;
}
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 71ecc7924b58..e4340e6d07a9 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -189,6 +189,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
return -EBUSY;
}
target_state = &drv->states[index];
+ broadcast = false;
}
/* Take note of the planned idle state. */
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 832a2c3f01ff..9e98a5fbbc1d 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -613,6 +613,18 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev)
struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
int error;
+ /*
+ * Return if cpu_device is not setup for this CPU.
+ *
+ * This could happen if the arch did not set up cpu_device
+ * since this CPU is not in cpu_present mask and the
+ * driver did not send a correct CPU mask during registration.
+ * Without this check we would end up passing bogus
+ * value for &cpu_dev->kobj in kobject_init_and_add()
+ */
+ if (!cpu_dev)
+ return -ENODEV;
+
kdev = kzalloc(sizeof(*kdev), GFP_KERNEL);
if (!kdev)
return -ENOMEM;