Skip to content

Commit 400f3f2

Browse files
committed
Merge tag 'pm+acpi-4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management and ACPI updates from Rafael Wysocki: "These are mostly fixes and cleanups (ACPI core, PM core, cpufreq, ACPI EC driver, device properties) including three reverts of recent intel_pstate driver commits due to a regression introduced by one of them plus support for Atom Airmont cores in intel_pstate (which really boils down to adding new frequency tables for Airmont) and additional turbostat updates. Specifics: - Revert three recent intel_pstate driver commits one of which introduced a regression and the remaining two depend on the problematic one (Rafael Wysocki). - Fix breakage related to the recently introduced ACPI _CCA object support in the PCI DMA setup code (Suravee Suthikulpanit). - Fix up the recently introduced ACPI CPPC support to only use the hardware-reduced version of the PCCT structure as the only architecture to support it (ARM64) will only use hardware-reduced ACPI anyway (Ashwin Chaugule). - Fix a cpufreq mediatek driver build problem (Arnd Bergmann). - Fix the SMBus transaction handling implementation in the ACPI core to avoid re-entrant calls to wait_event_timeout() which makes intermittent boot stalls related to the Smart Battery Subsystem initialization go away and revert a workaround of another problem with the same underlying root cause (Chris Bainbridge). - Fix the generic wakeup interrupts framework to avoid using invalid IRQ numbers (Dmitry Torokhov). - Remove a redundant check from the ACPI EC driver (Markus Elfring). - Modify the intel_pstate driver so it can support more Atom flavors than just one (Baytrail) and add support for Atom Airmont cores (which require new freqnency tables) to it (Philippe Longepe). - Clean up MSR-related symbols in turbostat (Len Brown)" * tag 'pm+acpi-4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PCI: Fix OF logic in pci_dma_configure() Revert "Documentation: kernel_parameters for Intel P state driver" cpufreq: mediatek: fix build error cpufreq: intel_pstate: Add separate support for Airmont cores cpufreq: intel_pstate: Replace BYT with ATOM Revert "cpufreq: intel_pstate: Use ACPI perf configuration" Revert "cpufreq: intel_pstate: Avoid calculation for max/min" ACPI-EC: Drop unnecessary check made before calling acpi_ec_delete_query() Revert "ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook" ACPI / SMBus: Fix boot stalls / high CPU caused by reentrant code PM / wakeirq: check that wake IRQ is valid before accepting it ACPI / CPPC: Use h/w reduced version of the PCCT structure x86: remove unused definition of MSR_NHM_PLATFORM_INFO tools/power turbostat: use new name for MSR_PLATFORM_INFO
2 parents 2f25535 + a3767e3 commit 400f3f2

File tree

11 files changed

+95
-299
lines changed

11 files changed

+95
-299
lines changed

Documentation/kernel-parameters.txt

-3
Original file line numberDiff line numberDiff line change
@@ -1583,9 +1583,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
15831583
hwp_only
15841584
Only load intel_pstate on systems which support
15851585
hardware P state control (HWP) if available.
1586-
no_acpi
1587-
Don't use ACPI processor performance control objects
1588-
_PSS and _PPC specified limits.
15891586

15901587
intremap= [X86-64, Intel-IOMMU]
15911588
on enable Interrupt Remapping (default)

arch/x86/include/asm/msr-index.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define MSR_IA32_PERFCTR0 0x000000c1
3636
#define MSR_IA32_PERFCTR1 0x000000c2
3737
#define MSR_FSB_FREQ 0x000000cd
38-
#define MSR_NHM_PLATFORM_INFO 0x000000ce
38+
#define MSR_PLATFORM_INFO 0x000000ce
3939

4040
#define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2
4141
#define NHM_C3_AUTO_DEMOTE (1UL << 25)
@@ -44,7 +44,6 @@
4444
#define SNB_C1_AUTO_UNDEMOTE (1UL << 27)
4545
#define SNB_C3_AUTO_UNDEMOTE (1UL << 28)
4646

47-
#define MSR_PLATFORM_INFO 0x000000ce
4847
#define MSR_MTRRcap 0x000000fe
4948
#define MSR_IA32_BBL_CR_CTL 0x00000119
5049
#define MSR_IA32_BBL_CR_CTL3 0x0000011e

drivers/acpi/cppc_acpi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ EXPORT_SYMBOL_GPL(acpi_get_psd_map);
304304

305305
static int register_pcc_channel(int pcc_subspace_idx)
306306
{
307-
struct acpi_pcct_subspace *cppc_ss;
307+
struct acpi_pcct_hw_reduced *cppc_ss;
308308
unsigned int len;
309309

310310
if (pcc_subspace_idx >= 0) {

drivers/acpi/ec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data)
11031103
}
11041104

11051105
err_exit:
1106-
if (result && q)
1106+
if (result)
11071107
acpi_ec_delete_query(q);
11081108
if (data)
11091109
*data = value;

drivers/acpi/sbshc.c

+7-41
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/delay.h>
1515
#include <linux/module.h>
1616
#include <linux/interrupt.h>
17-
#include <linux/dmi.h>
1817
#include "sbshc.h"
1918

2019
#define PREFIX "ACPI: "
@@ -30,6 +29,7 @@ struct acpi_smb_hc {
3029
u8 query_bit;
3130
smbus_alarm_callback callback;
3231
void *context;
32+
bool done;
3333
};
3434

3535
static int acpi_smbus_hc_add(struct acpi_device *device);
@@ -88,8 +88,6 @@ enum acpi_smb_offset {
8888
ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */
8989
};
9090

91-
static bool macbook;
92-
9391
static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data)
9492
{
9593
return ec_read(hc->offset + address, data);
@@ -100,27 +98,11 @@ static inline int smb_hc_write(struct acpi_smb_hc *hc, u8 address, u8 data)
10098
return ec_write(hc->offset + address, data);
10199
}
102100

103-
static inline int smb_check_done(struct acpi_smb_hc *hc)
104-
{
105-
union acpi_smb_status status = {.raw = 0};
106-
smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw);
107-
return status.fields.done && (status.fields.status == SMBUS_OK);
108-
}
109-
110101
static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout)
111102
{
112-
if (wait_event_timeout(hc->wait, smb_check_done(hc),
113-
msecs_to_jiffies(timeout)))
103+
if (wait_event_timeout(hc->wait, hc->done, msecs_to_jiffies(timeout)))
114104
return 0;
115-
/*
116-
* After the timeout happens, OS will try to check the status of SMbus.
117-
* If the status is what OS expected, it will be regarded as the bogus
118-
* timeout.
119-
*/
120-
if (smb_check_done(hc))
121-
return 0;
122-
else
123-
return -ETIME;
105+
return -ETIME;
124106
}
125107

126108
static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
@@ -135,8 +117,7 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
135117
}
136118

137119
mutex_lock(&hc->lock);
138-
if (macbook)
139-
udelay(5);
120+
hc->done = false;
140121
if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp))
141122
goto end;
142123
if (temp) {
@@ -235,8 +216,10 @@ static int smbus_alarm(void *context)
235216
if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw))
236217
return 0;
237218
/* Check if it is only a completion notify */
238-
if (status.fields.done)
219+
if (status.fields.done && status.fields.status == SMBUS_OK) {
220+
hc->done = true;
239221
wake_up(&hc->wait);
222+
}
240223
if (!status.fields.alarm)
241224
return 0;
242225
mutex_lock(&hc->lock);
@@ -262,29 +245,12 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
262245
acpi_handle handle, acpi_ec_query_func func,
263246
void *data);
264247

265-
static int macbook_dmi_match(const struct dmi_system_id *d)
266-
{
267-
pr_debug("Detected MacBook, enabling workaround\n");
268-
macbook = true;
269-
return 0;
270-
}
271-
272-
static struct dmi_system_id acpi_smbus_dmi_table[] = {
273-
{ macbook_dmi_match, "Apple MacBook", {
274-
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
275-
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") },
276-
},
277-
{ },
278-
};
279-
280248
static int acpi_smbus_hc_add(struct acpi_device *device)
281249
{
282250
int status;
283251
unsigned long long val;
284252
struct acpi_smb_hc *hc;
285253

286-
dmi_check_system(acpi_smbus_dmi_table);
287-
288254
if (!device)
289255
return -EINVAL;
290256

drivers/base/power/wakeirq.c

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ int dev_pm_set_wake_irq(struct device *dev, int irq)
6868
struct wake_irq *wirq;
6969
int err;
7070

71+
if (irq < 0)
72+
return -EINVAL;
73+
7174
wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
7275
if (!wirq)
7376
return -ENOMEM;
@@ -167,6 +170,9 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
167170
struct wake_irq *wirq;
168171
int err;
169172

173+
if (irq < 0)
174+
return -EINVAL;
175+
170176
wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
171177
if (!wirq)
172178
return -ENOMEM;

drivers/cpufreq/Kconfig.arm

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ config ARM_KIRKWOOD_CPUFREQ
8484
config ARM_MT8173_CPUFREQ
8585
bool "Mediatek MT8173 CPUFreq support"
8686
depends on ARCH_MEDIATEK && REGULATOR
87+
depends on ARM64 || (ARM_CPU_TOPOLOGY && COMPILE_TEST)
8788
depends on !CPU_THERMAL || THERMAL=y
8889
select PM_OPP
8990
help

drivers/cpufreq/Kconfig.x86

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
config X86_INTEL_PSTATE
66
bool "Intel P state control"
77
depends on X86
8-
select ACPI_PROCESSOR if ACPI
98
help
109
This driver provides a P state for Intel core processors.
1110
The driver implements an internal governor and will become

0 commit comments

Comments
 (0)