1
0
Fork 0
remarkable-linux/drivers
Gautham R. Shenoy 3b185e667b cpuidle: powernv: Fix promotion from snooze if next state disabled
commit 0a4ec6aa03 upstream.

The commit 78eaa10f02 ("cpuidle: powernv/pseries: Auto-promotion of
snooze to deeper idle state") introduced a timeout for the snooze idle
state so that it could be eventually be promoted to a deeper idle
state. The snooze timeout value is static and set to the target
residency of the next idle state, which would train the cpuidle
governor to pick the next idle state eventually.

The unfortunate side-effect of this is that if the next idle state(s)
is disabled, the CPU will forever remain in snooze, despite the fact
that the system is completely idle, and other deeper idle states are
available.

This patch fixes the issue by dynamically setting the snooze timeout
to the target residency of the next enabled state on the device.

Before Patch:
  POWER8 : Only nap disabled.
  $ cpupower monitor sleep 30
  sleep took 30.01297 seconds and exited with status 0
                |Idle_Stats
  PKG |CORE|CPU | snoo | Nap  | Fast
     0|   8|   0| 96.41|  0.00|  0.00
     0|   8|   1| 96.43|  0.00|  0.00
     0|   8|   2| 96.47|  0.00|  0.00
     0|   8|   3| 96.35|  0.00|  0.00
     0|   8|   4| 96.37|  0.00|  0.00
     0|   8|   5| 96.37|  0.00|  0.00
     0|   8|   6| 96.47|  0.00|  0.00
     0|   8|   7| 96.47|  0.00|  0.00

  POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1,
  stop2) disabled:
  $ cpupower monitor sleep 30
  sleep took 30.05033 seconds and exited with status 0
                |Idle_Stats
  PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop
     0|  16|   0| 89.79|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00
     0|  16|   1| 90.12|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00
     0|  16|   2| 90.21|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00
     0|  16|   3| 90.29|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00

After Patch:
  POWER8 : Only nap disabled.
  $ cpupower monitor sleep 30
  sleep took 30.01200 seconds and exited with status 0
                |Idle_Stats
  PKG |CORE|CPU | snoo | Nap  | Fast
     0|   8|   0| 16.58|  0.00| 77.21
     0|   8|   1| 18.42|  0.00| 75.38
     0|   8|   2|  4.70|  0.00| 94.09
     0|   8|   3| 17.06|  0.00| 81.73
     0|   8|   4|  3.06|  0.00| 95.73
     0|   8|   5|  7.00|  0.00| 96.80
     0|   8|   6|  1.00|  0.00| 98.79
     0|   8|   7|  5.62|  0.00| 94.17

  POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1,
  stop2) disabled:

  $ cpupower monitor sleep 30
  sleep took 30.02110 seconds and exited with status 0
                |Idle_Stats
  PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop
     0|   0|   0|  0.69|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  9.39| 89.70
     0|   0|   1|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.05| 93.21
     0|   0|   2|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00| 89.93
     0|   0|   3|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00|  0.00| 93.26

Fixes: 78eaa10f02 ("cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state")
Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:24:51 +02:00
..
accessibility License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acpi ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70 2018-06-21 04:02:47 +09:00
amba ARM: amba: Don't read past the end of sysfs "driver_override" buffer 2018-05-01 12:58:21 -07:00
android ANDROID: binder: prevent transactions into own process. 2018-05-01 12:58:20 -07:00
ata libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk 2018-06-26 08:06:32 +08:00
atm atm: zatm: Fix potential Spectre v1 2018-05-16 10:10:29 +02:00
auxdisplay auxdisplay: img-ascii-lcd: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2018-02-07 11:12:20 -08:00
base PM / OPP: Update voltage in case freq == old_freq 2018-07-03 11:24:47 +02:00
bcma License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
block nbd: use bd_set_size when updating disk size 2018-06-26 08:06:32 +08:00
bluetooth Bluetooth: hci_qca: Avoid missing rampatch failure with userspace fw loader 2018-07-03 11:24:49 +02:00
bus sunxi-rsb: Include OF based modalias in device uevent 2018-01-10 09:31:19 +01:00
cdrom cdrom: do not call check_disk_change() inside cdrom_open() 2018-05-30 07:52:34 +02:00
char ipmi:bt: Set the timeout before doing a capabilities check 2018-07-03 11:24:49 +02:00
clk clk: renesas: cpg-mssr: Stop using printk format %pCr 2018-07-03 11:24:48 +02:00
clocksource clocksource/drivers/imx-tpm: Correct some registers operation flow 2018-06-21 04:02:40 +09:00
connector
cpufreq cpufreq: governors: Fix long idle detection logic in load calculation 2018-06-26 08:06:32 +08:00
cpuidle cpuidle: powernv: Fix promotion from snooze if next state disabled 2018-07-03 11:24:51 +02:00
crypto crypto: omap-sham - fix memleak 2018-06-16 09:45:18 +02:00
dax dev/dax: fix uninitialized variable build warning 2017-12-20 10:10:34 +01:00
dca
devfreq PM / devfreq: Fix potential NULL pointer dereference in governor_store 2018-04-12 12:32:13 +02:00
dio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma dmaengine: qcom: bam_dma: get num-channels and num-ees from dt 2018-05-30 07:52:37 +02:00
dma-buf dma-buf: remove redundant initialization of sg_table 2018-06-05 11:41:57 +02:00
edac x86/mce/AMD, EDAC/mce_amd: Enumerate Reserved SMCA bank type 2018-04-19 08:56:20 +02:00
eisa License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extcon extcon: intel-cht-wc: Set direction and drv flags for V5 boost GPIO 2018-04-24 09:36:29 +02:00
firewire firewire-ohci: work around oversized DMA reads on JMicron controllers 2018-04-26 11:02:03 +02:00
firmware efi/libstub/arm64: Handle randomized TEXT_OFFSET 2018-06-21 04:03:01 +09:00
fmc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fpga fpga-manager: altera-ps-spi: preserve nCONFIG state 2018-05-01 12:58:24 -07:00
fsi
gpio gpio: No NULL owner 2018-06-16 09:45:14 +02:00
gpu drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl() 2018-06-21 04:03:00 +09:00
hid HID: wacom: Correct logical maximum Y for 2nd-gen Intuos Pro large 2018-06-26 08:06:33 +08:00
hsi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv Drivers: hv: vmbus: do not mark HV_PCIE as perf_device 2018-04-19 08:56:16 +02:00
hwmon hwmon: (pmbus/adm1275) Accept negative page register values 2018-05-30 07:52:34 +02:00
hwspinlock License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hwtracing intel_th: Use correct device when freeing buffers 2018-06-05 11:41:59 +02:00
i2c i2c: viperboard: return message count on master_xfer success 2018-06-21 04:03:00 +09:00
ide cdrom: do not call check_disk_change() inside cdrom_open() 2018-05-30 07:52:34 +02:00
idle Revert "x86/mm: Stop calling leave_mm() in idle code" 2017-11-04 15:01:50 +01:00
iio iio: adc: select buffer for at91-sama5d2_adc 2018-06-05 11:41:58 +02:00
infiniband RDMA/cma: Do not query GID during QP state transition to RTR 2018-06-21 04:02:54 +09:00
input Input: atmel_mxt_ts - fix the firmware update 2018-06-21 04:02:52 +09:00
iommu iommu/vt-d: fix shift-out-of-bounds in bug checking 2018-06-21 04:02:53 +09:00
ipack
irqchip irqchip/qcom: Fix check for spurious interrupts 2018-05-09 09:51:56 +02:00
isdn isdn: eicon: fix a missing-check bug 2018-06-11 22:49:19 +02:00
leds leds: pm8058: Silence pointer to integer size warning 2018-03-19 08:42:50 +01:00
lightnvm lightnvm: pblk: protect line bitmap while submitting meta io 2017-12-20 10:10:38 +01:00
macintosh drivers: macintosh: rack-meter: really fix bogus memsets 2018-05-30 07:52:27 +02:00
mailbox mailbox: mailbox-test: don't rely on rx_buffer content to signal data ready 2017-12-14 09:53:12 +01:00
mcb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
md bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set 2018-05-30 07:52:30 +02:00
media media: cx25821: prevent out-of-bounds read on array card 2018-05-25 16:17:58 +02:00
memory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memstick License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
message scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo() 2018-05-25 16:17:47 +02:00
mfd mfd: twl6040: Fix child-node lookup 2017-12-29 17:53:46 +01:00
misc vmw_balloon: fixing double free when batching mode is off 2018-06-16 09:45:16 +02:00
mmc mmc: sdhci-iproc: add SDHCI_QUIRK2_HOST_OFF_CARD_ON for cygnus 2018-05-30 07:51:48 +02:00
mtd mtd: rawnand: tango: Fix struct clk memory leak 2018-05-01 12:58:19 -07:00
mux mux: core: fix double get_device() 2018-01-17 09:45:27 +01:00
net iwlwifi: fw: harden page loading code 2018-06-26 08:06:33 +08:00
nfc NFC: pn533: don't send USB data off of the stack 2018-06-16 09:45:15 +02:00
ntb ntb_transport: Fix bug with max_mw_size parameter 2018-04-26 11:02:13 +02:00
nubus License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nvdimm libnvdimm, namespace: use a safe lookup for dimm device name 2018-04-24 09:36:32 +02:00
nvme nvme: Set integrity flag for user passthrough commands 2018-06-21 04:02:53 +09:00
nvmem License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
of earlycon: Use a pointer table to fix __earlycon_table stride 2018-05-01 12:58:24 -07:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
parisc parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode 2018-05-30 07:52:28 +02:00
parport parport_pc: Add support for WCH CH382L PCI-E single parallel port card. 2018-04-08 14:26:31 +02:00
pci PCI: kirin: Fix reset gpio name 2018-06-21 04:02:42 +09:00
pcmcia PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle 2018-05-30 07:52:39 +02:00
perf License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy phy: qcom-qusb2: Fix crash if nvmem cell not specified 2018-06-16 09:45:16 +02:00
pinctrl Revert "pinctrl: msm: Use dynamic GPIO numbering" 2018-06-05 11:41:55 +02:00
platform platform/chrome: cros_ec_lpc: remove redundant pointer request 2018-06-05 11:41:57 +02:00
pnp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
power power: supply: ltc2941-battery-gauge: Fix temperature units 2018-05-30 07:52:38 +02:00
powercap
pps
ps3
ptp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pwm pwm: rcar: Fix a condition to prevent mismatch value setting to duty 2018-04-24 09:36:34 +02:00
rapidio drivers/rapidio/devices/rio_mport_cdev.c: fix resource leak in error handling path in 'rio_dma_transfer()' 2017-12-14 09:53:08 +01:00
ras License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
regulator regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()' 2018-05-30 07:52:41 +02:00
remoteproc remoteproc: qcom: Fix potential device node leaks 2018-06-21 04:02:48 +09:00
reset License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rpmsg rpmsg: added MODULE_ALIAS for rpmsg_char 2018-06-21 04:02:48 +09:00
rtc rtc: goldfish: Add missing MODULE_LICENSE 2018-05-25 16:18:02 +02:00
s390 s390/smsgiucv: disable SMSG on module unload 2018-06-21 04:02:41 +09:00
sbus License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scsi scsi: vmw-pvscsi: return DID_BUS_BUSY for adapter-initated aborts 2018-06-21 04:02:52 +09:00
sfi
sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sn
soc soc: bcm: raspberrypi-power: Fix use of __packed 2018-06-21 04:02:42 +09:00
spi spi: bcm2835aux: ensure interrupts are enabled for shared handler 2018-06-21 04:02:54 +09:00
spmi
ssb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
staging staging: android: ion: Switch to pr_warn_once in ion_buffer_destroy 2018-06-16 09:45:15 +02:00
target scsi: target: fix crash with iscsi target and dvd 2018-06-21 04:02:43 +09:00
tc
tee tee: check shm references are consistent in offset/size 2018-06-21 04:02:54 +09:00
thermal thermal: bcm2835: Stop using printk format %pCr 2018-07-03 11:24:48 +02:00
thunderbolt thunderbolt: Prevent crash when ICM firmware is not running 2018-04-24 09:36:29 +02:00
tty serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version 2018-07-03 11:24:47 +02:00
uio uio_hv_generic: check that host supports monitor page 2018-04-12 12:32:19 +02:00
usb usb: do not reset if a low-speed or full-speed device timed out 2018-07-03 11:24:47 +02:00
uwb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio vfio/pci: Virtualize Maximum Read Request Size 2018-04-24 09:36:34 +02:00
vhost vhost: fix info leak due to uninitialized memory 2018-06-26 08:06:33 +08:00
video fbdev: Fixing arbitrary kernel leak in case FBIOGETCMAP_SPARC in sbusfb_ioctl_helper(). 2018-05-30 07:52:12 +02:00
virt
virtio virtio_ring: fix num_free handling in error case 2018-03-15 10:54:32 +01:00
vlynq
vme License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
w1 1wire: family module autoload fails because of upper/lower case mismatch. 2018-07-03 11:24:47 +02:00
watchdog watchdog: asm9260_wdt: fix error handling in asm9260_wdt_probe() 2018-05-30 07:52:36 +02:00
xen xen: xenbus_dev_frontend: Really return response string 2018-06-21 04:02:42 +09:00
zorro zorro: Set up z->dev.dma_mask for the DMA API 2018-05-30 07:52:30 +02:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile usb: build drivers/usb/common/ when USB_SUPPORT is set 2018-02-25 11:07:53 +01:00