Commit 400f3f25 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 2f255351 a3767e3c
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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)
+1 −2
Original line number Diff line number Diff line
@@ -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)
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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;
+7 −41
Original line number Diff line number Diff line
@@ -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: "
@@ -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);
@@ -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);
@@ -100,26 +98,10 @@ 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;
}

@@ -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) {
@@ -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);
@@ -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;

Loading