Skip to content

Commit

Permalink
Merge tag 'pm+acpi-4.4-rc2' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
Linus Torvalds committed Nov 20, 2015
2 parents 2f25535 + a3767e3 commit 400f3f2
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 299 deletions.
3 changes: 0 additions & 3 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1583,9 +1583,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
hwp_only
Only load intel_pstate on systems which support
hardware P state control (HWP) if available.
no_acpi
Don't use ACPI processor performance control objects
_PSS and _PPC specified limits.

intremap= [X86-64, Intel-IOMMU]
on enable Interrupt Remapping (default)
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define MSR_IA32_PERFCTR0 0x000000c1
#define MSR_IA32_PERFCTR1 0x000000c2
#define MSR_FSB_FREQ 0x000000cd
#define MSR_NHM_PLATFORM_INFO 0x000000ce
#define MSR_PLATFORM_INFO 0x000000ce

#define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2
#define NHM_C3_AUTO_DEMOTE (1UL << 25)
Expand All @@ -44,7 +44,6 @@
#define SNB_C1_AUTO_UNDEMOTE (1UL << 27)
#define SNB_C3_AUTO_UNDEMOTE (1UL << 28)

#define MSR_PLATFORM_INFO 0x000000ce
#define MSR_MTRRcap 0x000000fe
#define MSR_IA32_BBL_CR_CTL 0x00000119
#define MSR_IA32_BBL_CR_CTL3 0x0000011e
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/cppc_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ EXPORT_SYMBOL_GPL(acpi_get_psd_map);

static int register_pcc_channel(int pcc_subspace_idx)
{
struct acpi_pcct_subspace *cppc_ss;
struct acpi_pcct_hw_reduced *cppc_ss;
unsigned int len;

if (pcc_subspace_idx >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data)
}

err_exit:
if (result && q)
if (result)
acpi_ec_delete_query(q);
if (data)
*data = value;
Expand Down
48 changes: 7 additions & 41 deletions drivers/acpi/sbshc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/dmi.h>
#include "sbshc.h"

#define PREFIX "ACPI: "
Expand All @@ -30,6 +29,7 @@ struct acpi_smb_hc {
u8 query_bit;
smbus_alarm_callback callback;
void *context;
bool done;
};

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

static bool macbook;

static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data)
{
return ec_read(hc->offset + address, data);
Expand All @@ -100,27 +98,11 @@ static inline int smb_hc_write(struct acpi_smb_hc *hc, u8 address, u8 data)
return ec_write(hc->offset + address, data);
}

static inline int smb_check_done(struct acpi_smb_hc *hc)
{
union acpi_smb_status status = {.raw = 0};
smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw);
return status.fields.done && (status.fields.status == SMBUS_OK);
}

static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout)
{
if (wait_event_timeout(hc->wait, smb_check_done(hc),
msecs_to_jiffies(timeout)))
if (wait_event_timeout(hc->wait, hc->done, msecs_to_jiffies(timeout)))
return 0;
/*
* After the timeout happens, OS will try to check the status of SMbus.
* If the status is what OS expected, it will be regarded as the bogus
* timeout.
*/
if (smb_check_done(hc))
return 0;
else
return -ETIME;
return -ETIME;
}

static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
Expand All @@ -135,8 +117,7 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
}

mutex_lock(&hc->lock);
if (macbook)
udelay(5);
hc->done = false;
if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp))
goto end;
if (temp) {
Expand Down Expand Up @@ -235,8 +216,10 @@ static int smbus_alarm(void *context)
if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw))
return 0;
/* Check if it is only a completion notify */
if (status.fields.done)
if (status.fields.done && status.fields.status == SMBUS_OK) {
hc->done = true;
wake_up(&hc->wait);
}
if (!status.fields.alarm)
return 0;
mutex_lock(&hc->lock);
Expand All @@ -262,29 +245,12 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
acpi_handle handle, acpi_ec_query_func func,
void *data);

static int macbook_dmi_match(const struct dmi_system_id *d)
{
pr_debug("Detected MacBook, enabling workaround\n");
macbook = true;
return 0;
}

static struct dmi_system_id acpi_smbus_dmi_table[] = {
{ macbook_dmi_match, "Apple MacBook", {
DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") },
},
{ },
};

static int acpi_smbus_hc_add(struct acpi_device *device)
{
int status;
unsigned long long val;
struct acpi_smb_hc *hc;

dmi_check_system(acpi_smbus_dmi_table);

if (!device)
return -EINVAL;

Expand Down
6 changes: 6 additions & 0 deletions drivers/base/power/wakeirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ int dev_pm_set_wake_irq(struct device *dev, int irq)
struct wake_irq *wirq;
int err;

if (irq < 0)
return -EINVAL;

wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
if (!wirq)
return -ENOMEM;
Expand Down Expand Up @@ -167,6 +170,9 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
struct wake_irq *wirq;
int err;

if (irq < 0)
return -EINVAL;

wirq = kzalloc(sizeof(*wirq), GFP_KERNEL);
if (!wirq)
return -ENOMEM;
Expand Down
1 change: 1 addition & 0 deletions drivers/cpufreq/Kconfig.arm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ config ARM_KIRKWOOD_CPUFREQ
config ARM_MT8173_CPUFREQ
bool "Mediatek MT8173 CPUFreq support"
depends on ARCH_MEDIATEK && REGULATOR
depends on ARM64 || (ARM_CPU_TOPOLOGY && COMPILE_TEST)
depends on !CPU_THERMAL || THERMAL=y
select PM_OPP
help
Expand Down
1 change: 0 additions & 1 deletion drivers/cpufreq/Kconfig.x86
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
config X86_INTEL_PSTATE
bool "Intel P state control"
depends on X86
select ACPI_PROCESSOR if ACPI
help
This driver provides a P state for Intel core processors.
The driver implements an internal governor and will become
Expand Down
Loading

0 comments on commit 400f3f2

Please sign in to comment.