diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-26 14:03:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-26 14:03:02 -0400 |
| commit | e58d911f98690db97a7ad93d2ecf5ebf0733fb5f (patch) | |
| tree | 95a1bcbaf30e633e016b1d346d721ee5ff6bf56f | |
| parent | 665fa0000aedb5f3d6b4d3b040d323074e1b7c40 (diff) | |
| parent | e140c4af1b63125dff629e8339793390201e2470 (diff) | |
Merge tag 'pm-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
"These are a Low Power S0 Idle quirk, a hibernation handling fix for
the PCI bus type and a brcmstb-avs-cpufreq driver fixup removing
development debug code from it.
Specifics:
- Blacklist the Low Power S0 Idle _DSM on ThinkPad X1 Tablet(2016)
where it causes issues and make it use ACPI S3 which works instead
of the non-working suspend-to-idle by default (Chen Yu).
- Fix the handling of hibernation in the PCI core for devices with
the DPM_FLAG_SMART_SUSPEND flag set to fix a regression affecting
intel-lpss I2C devices (Mika Westerberg).
- Drop development debug code from the brcmstb-avs-cpufreq driver
(Markus Mayer)"
* tag 'pm-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: brcmstb-avs-cpufreq: remove development debug support
PCI / PM: Do not clear state_saved in pci_pm_freeze() when smart suspend is set
ACPI / PM: Blacklist Low Power S0 Idle _DSM for ThinkPad X1 Tablet(2016)
| -rw-r--r-- | drivers/acpi/sleep.c | 13 | ||||
| -rw-r--r-- | drivers/cpufreq/Kconfig.arm | 10 | ||||
| -rw-r--r-- | drivers/cpufreq/brcmstb-avs-cpufreq.c | 323 | ||||
| -rw-r--r-- | drivers/pci/pci-driver.c | 5 |
4 files changed, 17 insertions, 334 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 99a1a650326d..974e58457697 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -364,6 +364,19 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { | |||
| 364 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"), | 364 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"), |
| 365 | }, | 365 | }, |
| 366 | }, | 366 | }, |
| 367 | /* | ||
| 368 | * ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using | ||
| 369 | * the Low Power S0 Idle firmware interface (see | ||
| 370 | * https://bugzilla.kernel.org/show_bug.cgi?id=199057). | ||
| 371 | */ | ||
| 372 | { | ||
| 373 | .callback = init_no_lps0, | ||
| 374 | .ident = "ThinkPad X1 Tablet(2016)", | ||
| 375 | .matches = { | ||
| 376 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 377 | DMI_MATCH(DMI_PRODUCT_NAME, "20GGA00L00"), | ||
| 378 | }, | ||
| 379 | }, | ||
| 367 | {}, | 380 | {}, |
| 368 | }; | 381 | }; |
| 369 | 382 | ||
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 7f56fe5183f2..de55c7d57438 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm | |||
| @@ -71,16 +71,6 @@ config ARM_BRCMSTB_AVS_CPUFREQ | |||
| 71 | 71 | ||
| 72 | Say Y, if you have a Broadcom SoC with AVS support for DFS or DVFS. | 72 | Say Y, if you have a Broadcom SoC with AVS support for DFS or DVFS. |
| 73 | 73 | ||
| 74 | config ARM_BRCMSTB_AVS_CPUFREQ_DEBUG | ||
| 75 | bool "Broadcom STB AVS CPUfreq driver sysfs debug capability" | ||
| 76 | depends on ARM_BRCMSTB_AVS_CPUFREQ | ||
| 77 | help | ||
| 78 | Enabling this option turns on debug support via sysfs under | ||
| 79 | /sys/kernel/debug/brcmstb-avs-cpufreq. It is possible to read all and | ||
| 80 | write some AVS mailbox registers through sysfs entries. | ||
| 81 | |||
| 82 | If in doubt, say N. | ||
| 83 | |||
| 84 | config ARM_EXYNOS5440_CPUFREQ | 74 | config ARM_EXYNOS5440_CPUFREQ |
| 85 | tristate "SAMSUNG EXYNOS5440" | 75 | tristate "SAMSUNG EXYNOS5440" |
| 86 | depends on SOC_EXYNOS5440 | 76 | depends on SOC_EXYNOS5440 |
diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c index 6cdac1aaf23c..b07559b9ed99 100644 --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c | |||
| @@ -49,13 +49,6 @@ | |||
| 49 | #include <linux/platform_device.h> | 49 | #include <linux/platform_device.h> |
| 50 | #include <linux/semaphore.h> | 50 | #include <linux/semaphore.h> |
| 51 | 51 | ||
| 52 | #ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG | ||
| 53 | #include <linux/ctype.h> | ||
| 54 | #include <linux/debugfs.h> | ||
| 55 | #include <linux/slab.h> | ||
| 56 | #include <linux/uaccess.h> | ||
| 57 | #endif | ||
| 58 | |||
| 59 | /* Max number of arguments AVS calls take */ | 52 | /* Max number of arguments AVS calls take */ |
| 60 | #define AVS_MAX_CMD_ARGS 4 | 53 | #define AVS_MAX_CMD_ARGS 4 |
| 61 | /* | 54 | /* |
| @@ -182,88 +175,11 @@ struct private_data { | |||
| 182 | void __iomem *base; | 175 | void __iomem *base; |
| 183 | void __iomem *avs_intr_base; | 176 | void __iomem *avs_intr_base; |
| 184 | struct device *dev; | 177 | struct device *dev; |
| 185 | #ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG | ||
| 186 | struct dentry *debugfs; | ||
| 187 | #endif | ||
| 188 | struct completion done; | 178 | struct completion done; |
| 189 | struct semaphore sem; | 179 | struct semaphore sem; |
| 190 | struct pmap pmap; | 180 | struct pmap pmap; |
| 191 | }; | 181 | }; |
| 192 | 182 | ||
| 193 | #ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG | ||
| 194 | |||
| 195 | enum debugfs_format { | ||
| 196 | DEBUGFS_NORMAL, | ||
| 197 | DEBUGFS_FLOAT, | ||
| 198 | DEBUGFS_REV, | ||
| 199 | }; | ||
| 200 | |||
| 201 | struct debugfs_data { | ||
| 202 | struct debugfs_entry *entry; | ||
| 203 | struct private_data *priv; | ||
| 204 | }; | ||
| 205 | |||
| 206 | struct debugfs_entry { | ||
| 207 | char *name; | ||
| 208 | u32 offset; | ||
| 209 | fmode_t mode; | ||
| 210 | enum debugfs_format format; | ||
| 211 | }; | ||
| 212 | |||
| 213 | #define DEBUGFS_ENTRY(name, mode, format) { \ | ||
| 214 | #name, AVS_MBOX_##name, mode, format \ | ||
| 215 | } | ||
| 216 | |||
| 217 | /* | ||
| 218 | * These are used for debugfs only. Otherwise we use AVS_MBOX_PARAM() directly. | ||
| 219 | */ | ||
| 220 | #define AVS_MBOX_PARAM1 AVS_MBOX_PARAM(0) | ||
| 221 | #define AVS_MBOX_PARAM2 AVS_MBOX_PARAM(1) | ||
| 222 | #define AVS_MBOX_PARAM3 AVS_MBOX_PARAM(2) | ||
| 223 | #define AVS_MBOX_PARAM4 AVS_MBOX_PARAM(3) | ||
| 224 | |||
| 225 | /* | ||
| 226 | * This table stores the name, access permissions and offset for each hardware | ||
| 227 | * register and is used to generate debugfs entries. | ||
| 228 | */ | ||
| 229 | static struct debugfs_entry debugfs_entries[] = { | ||
| 230 | DEBUGFS_ENTRY(COMMAND, S_IWUSR, DEBUGFS_NORMAL), | ||
| 231 | DEBUGFS_ENTRY(STATUS, S_IWUSR, DEBUGFS_NORMAL), | ||
| 232 | DEBUGFS_ENTRY(VOLTAGE0, 0, DEBUGFS_FLOAT), | ||
| 233 | DEBUGFS_ENTRY(TEMP0, 0, DEBUGFS_FLOAT), | ||
| 234 | DEBUGFS_ENTRY(PV0, 0, DEBUGFS_FLOAT), | ||
| 235 | DEBUGFS_ENTRY(MV0, 0, DEBUGFS_FLOAT), | ||
| 236 | DEBUGFS_ENTRY(PARAM1, S_IWUSR, DEBUGFS_NORMAL), | ||
| 237 | DEBUGFS_ENTRY(PARAM2, S_IWUSR, DEBUGFS_NORMAL), | ||
| 238 | DEBUGFS_ENTRY(PARAM3, S_IWUSR, DEBUGFS_NORMAL), | ||
| 239 | DEBUGFS_ENTRY(PARAM4, S_IWUSR, DEBUGFS_NORMAL), | ||
| 240 | DEBUGFS_ENTRY(REVISION, 0, DEBUGFS_REV), | ||
| 241 | DEBUGFS_ENTRY(PSTATE, 0, DEBUGFS_NORMAL), | ||
| 242 | DEBUGFS_ENTRY(HEARTBEAT, 0, DEBUGFS_NORMAL), | ||
| 243 | DEBUGFS_ENTRY(MAGIC, S_IWUSR, DEBUGFS_NORMAL), | ||
| 244 | DEBUGFS_ENTRY(SIGMA_HVT, 0, DEBUGFS_NORMAL), | ||
| 245 | DEBUGFS_ENTRY(SIGMA_SVT, 0, DEBUGFS_NORMAL), | ||
| 246 | DEBUGFS_ENTRY(VOLTAGE1, 0, DEBUGFS_FLOAT), | ||
| 247 | DEBUGFS_ENTRY(TEMP1, 0, DEBUGFS_FLOAT), | ||
| 248 | DEBUGFS_ENTRY(PV1, 0, DEBUGFS_FLOAT), | ||
| 249 | DEBUGFS_ENTRY(MV1, 0, DEBUGFS_FLOAT), | ||
| 250 | DEBUGFS_ENTRY(FREQUENCY, 0, DEBUGFS_NORMAL), | ||
| 251 | }; | ||
| 252 | |||
| 253 | static int brcm_avs_target_index(struct cpufreq_policy *, unsigned int); | ||
| 254 | |||
| 255 | static char *__strtolower(char *s) | ||
| 256 | { | ||
| 257 | char *p; | ||
| 258 | |||
| 259 | for (p = s; *p; p++) | ||
| 260 | *p = tolower(*p); | ||
| 261 | |||
| 262 | return s; | ||
| 263 | } | ||
| 264 | |||
| 265 | #endif /* CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG */ | ||
| 266 | |||
| 267 | static void __iomem *__map_region(const char *name) | 183 | static void __iomem *__map_region(const char *name) |
| 268 | { | 184 | { |
| 269 | struct device_node *np; | 185 | struct device_node *np; |
| @@ -516,238 +432,6 @@ brcm_avs_get_freq_table(struct device *dev, struct private_data *priv) | |||
| 516 | return table; | 432 | return table; |
| 517 | } | 433 | } |
| 518 | 434 | ||
| 519 | #ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG | ||
| 520 | |||
| 521 | #define MANT(x) (unsigned int)(abs((x)) / 1000) | ||
| 522 | #define FRAC(x) (unsigned int)(abs((x)) - abs((x)) / 1000 * 1000) | ||
| 523 | |||
| 524 | static int brcm_avs_debug_show(struct seq_file *s, void *data) | ||
| 525 | { | ||
| 526 | struct debugfs_data *dbgfs = s->private; | ||
| 527 | void __iomem *base; | ||
| 528 | u32 val, offset; | ||
| 529 | |||
| 530 | if (!dbgfs) { | ||
| 531 | seq_puts(s, "No device pointer\n"); | ||
| 532 | return 0; | ||
| 533 | } | ||
| 534 | |||
| 535 | base = dbgfs->priv->base; | ||
| 536 | offset = dbgfs->entry->offset; | ||
| 537 | val = readl(base + offset); | ||
| 538 | switch (dbgfs->entry->format) { | ||
| 539 | case DEBUGFS_NORMAL: | ||
| 540 | seq_printf(s, "%u\n", val); | ||
| 541 | break; | ||
| 542 | case DEBUGFS_FLOAT: | ||
| 543 | seq_printf(s, "%d.%03d\n", MANT(val), FRAC(val)); | ||
| 544 | break; | ||
| 545 | case DEBUGFS_REV: | ||
| 546 | seq_printf(s, "%c.%c.%c.%c\n", (val >> 24 & 0xff), | ||
| 547 | (val >> 16 & 0xff), (val >> 8 & 0xff), | ||
| 548 | val & 0xff); | ||
| 549 | break; | ||
| 550 | } | ||
| 551 | seq_printf(s, "0x%08x\n", val); | ||
| 552 | |||
| 553 | return 0; | ||
| 554 | } | < | |
