Commit 20afa6e2 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "They fix an ACPI thermal management regression introduced by a recent
  FADT handling cleanup, an ACPI tools build issue introduced by a
  recent ACPICA commit and a PCC mailbox initialization bug causing
  lockdep to complain loudly.

  Specifics:

   - Revert a recent ACPICA cleanup that attempted to get rid of all
     FADT version 2 legacy, but broke ACPI thermal management on at
     least one system (Rafael Wysocki).

   - Fix cross-compiled builds of ACPI tools that stopped working after
     a recent cleanup related to the handling of header files in ACPICA
     (Lv Zheng).

   - Fix a locking issue in the PCC channel initialization code that
     invokes devm_request_irq() under a spinlock (among other things)
     and causes lockdep to complain (Hoan Tran)"

* tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  tools/power/acpi: Remove direct kernel source include reference
  mailbox: PCC: Fix lockdep warning when request PCC channel
  Revert "ACPICA: FADT support cleanup"
parents 04e36857 aab0b243
......@@ -480,19 +480,17 @@ static void acpi_tb_convert_fadt(void)
u32 i;
/*
* For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which
* For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields.
*
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located
* at offset 45, 55, 95, and the word located at offset 109, 110.
*
* Note: The FADT revision value is unreliable because of BIOS errors.
* The table length is instead used as the final word on the version.
*
* Note: FADT revision 3 is the ACPI 2.0 version of the FADT.
* Note: The FADT revision value is unreliable. Only the length can be
* trusted.
*/
if (acpi_gbl_FADT.header.length <= ACPI_FADT_V3_SIZE) {
if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) {
acpi_gbl_FADT.preferred_profile = 0;
acpi_gbl_FADT.pstate_control = 0;
acpi_gbl_FADT.cst_control = 0;
......
......@@ -65,6 +65,7 @@
#include <linux/mailbox_controller.h>
#include <linux/mailbox_client.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <acpi/pcc.h>
#include "mailbox.h"
......@@ -267,6 +268,8 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
chan->txdone_method |= TXDONE_BY_ACK;
spin_unlock_irqrestore(&chan->lock, flags);
if (pcc_doorbell_irq[subspace_id] > 0) {
int rc;
......@@ -275,12 +278,11 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
if (unlikely(rc)) {
dev_err(dev, "failed to register PCC interrupt %d\n",
pcc_doorbell_irq[subspace_id]);
pcc_mbox_free_channel(chan);
chan = ERR_PTR(rc);
}
}
spin_unlock_irqrestore(&chan->lock, flags);
return chan;
}
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
......@@ -304,20 +306,19 @@ void pcc_mbox_free_channel(struct mbox_chan *chan)
return;
}
if (pcc_doorbell_irq[id] > 0)
devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
spin_lock_irqsave(&chan->lock, flags);
chan->cl = NULL;
chan->active_req = NULL;
if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
chan->txdone_method = TXDONE_BY_POLL;
if (pcc_doorbell_irq[id] > 0)
devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
spin_unlock_irqrestore(&chan->lock, flags);
}
EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
/**
* pcc_send_data - Called from Mailbox Controller code. Used
* here only to ring the channel doorbell. The PCC client
......
This diff is collapsed.
......@@ -191,6 +191,9 @@
#ifndef __init
#define __init
#endif
#ifndef __iomem
#define __iomem
#endif
/* Host-dependent types and defines for user-space ACPICA */
......
......@@ -8,18 +8,19 @@
# as published by the Free Software Foundation; version 2
# of the License.
include ../../../../scripts/Makefile.include
OUTPUT=./
ifeq ("$(origin O)", "command line")
OUTPUT := $(O)/
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif
ifneq ($(OUTPUT),)
# check that the output directory actually exists
OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
include $(srctree)/../../scripts/Makefile.include
OUTPUT=$(srctree)/
ifeq ("$(origin O)", "command line")
OUTPUT := $(O)/power/acpi/
endif
#$(info Determined 'OUTPUT' to be $(OUTPUT))
# --- CONFIGURATION BEGIN ---
......@@ -70,8 +71,8 @@ WARNINGS := -Wall
WARNINGS += $(call cc-supports,-Wstrict-prototypes)
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
KERNEL_INCLUDE := ../../../include
ACPICA_INCLUDE := ../../../drivers/acpi/acpica
KERNEL_INCLUDE := $(OUTPUT)include
ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
CFLAGS += $(WARNINGS)
......
......@@ -8,28 +8,42 @@
# as published by the Free Software Foundation; version 2
# of the License.
$(OUTPUT)$(TOOL): $(TOOL_OBJS) FORCE
$(ECHO) " LD " $@
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(TOOL_OBJS) -L$(OUTPUT) -o $@
objdir := $(OUTPUT)tools/$(TOOL)/
toolobjs := $(addprefix $(objdir),$(TOOL_OBJS))
$(OUTPUT)$(TOOL): $(toolobjs) FORCE
$(ECHO) " LD " $(subst $(OUTPUT),,$@)
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@
$(ECHO) " STRIP " $(subst $(OUTPUT),,$@)
$(QUIET) $(STRIPCMD) $@
$(OUTPUT)%.o: %.c
$(ECHO) " CC " $@
$(KERNEL_INCLUDE):
$(ECHO) " MKDIR " $(subst $(OUTPUT),,$@)
$(QUIET) mkdir -p $(KERNEL_INCLUDE)
$(ECHO) " CP " $(subst $(OUTPUT),,$@)
$(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/
$(objdir)%.o: %.c $(KERNEL_INCLUDE)
$(ECHO) " CC " $(subst $(OUTPUT),,$@)
$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
all: $(OUTPUT)$(TOOL)
clean:
-find $(OUTPUT) \( -not -type d \) \
-and \( -name '*~' -o -name '*.[oas]' \) \
-type f -print \
| xargs rm -f
-rm -f $(OUTPUT)$(TOOL)
$(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir))
$(QUIET) find $(objdir) \( -not -type d \)\
-and \( -name '*~' -o -name '*.[oas]' \)\
-type f -print | xargs rm -f
$(ECHO) " RM " $(TOOL)
$(QUIET) rm -f $(OUTPUT)$(TOOL)
$(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE))
$(QUIET) rm -rf $(KERNEL_INCLUDE)
install-tools:
$(INSTALL) -d $(DESTDIR)${sbindir}
$(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)${sbindir}
$(ECHO) " INST " $(TOOL)
$(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
$(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
uninstall-tools:
- rm -f $(DESTDIR)${sbindir}/$(TOOL)
$(ECHO) " UNINST " $(TOOL)
$(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)
install: all install-tools $(EXTRA_INSTALL)
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
......
......@@ -17,9 +17,7 @@ vpath %.c \
../../os_specific/service_layers\
.
CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\
-I.\
-I../../../../../drivers/acpi/acpica\
-I../../../../../include
-I.
LDFLAGS += -lpthread
TOOL_OBJS = \
acpidbg.o
......
......@@ -12,10 +12,16 @@
#include <acpi/acpi.h>
/* Headers not included by include/acpi/platform/aclinux.h */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include <stdbool.h>
#include <fcntl.h>
#include <assert.h>
#include <linux/circ_buf.h>
#include <sys/select.h>
#include "../../../../../include/linux/circ_buf.h"
#define ACPI_AML_FILE "/sys/kernel/debug/acpi/acpidbg"
#define ACPI_AML_SEC_TICK 1
......
......@@ -19,9 +19,7 @@ vpath %.c \
./\
../../common\
../../os_specific/service_layers
CFLAGS += -DACPI_DUMP_APP -I.\
-I../../../../../drivers/acpi/acpica\
-I../../../../../include
CFLAGS += -DACPI_DUMP_APP -I.
TOOL_OBJS = \
apdump.o\
apfiles.o\
......@@ -49,7 +47,9 @@ TOOL_OBJS = \
include ../../Makefile.rules
install-man: ../../man/acpidump.8
$(INSTALL_DATA) -D $< $(DESTDIR)${mandir}/man8/acpidump.8
install-man: $(srctree)/man/acpidump.8
$(ECHO) " INST " acpidump.8
$(QUIET) $(INSTALL_DATA) -D $< $(DESTDIR)$(mandir)/man8/acpidump.8
uninstall-man:
- rm -f $(DESTDIR)${mandir}/man8/acpidump.8
$(ECHO) " UNINST " acpidump.8
$(QUIET) rm -f $(DESTDIR)$(mandir)/man8/acpidump.8
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment