Commit aab0b243 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpica-fixes', 'acpi-cppc-fixes' and 'acpi-tools-fixes'

* acpica-fixes:
  Revert "ACPICA: FADT support cleanup"

* acpi-cppc-fixes:
  mailbox: PCC: Fix lockdep warning when request PCC channel

* acpi-tools-fixes:
  tools/power/acpi: Remove direct kernel source include reference
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@
#include <linux/mailbox_controller.h>
#include <linux/mailbox_controller.h>
#include <linux/mailbox_client.h>
#include <linux/mailbox_client.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <acpi/pcc.h>


#include "mailbox.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)
	if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
		chan->txdone_method |= TXDONE_BY_ACK;
		chan->txdone_method |= TXDONE_BY_ACK;


	spin_unlock_irqrestore(&chan->lock, flags);

	if (pcc_doorbell_irq[subspace_id] > 0) {
	if (pcc_doorbell_irq[subspace_id] > 0) {
		int rc;
		int rc;


@@ -275,12 +278,11 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
		if (unlikely(rc)) {
		if (unlikely(rc)) {
			dev_err(dev, "failed to register PCC interrupt %d\n",
			dev_err(dev, "failed to register PCC interrupt %d\n",
				pcc_doorbell_irq[subspace_id]);
				pcc_doorbell_irq[subspace_id]);
			pcc_mbox_free_channel(chan);
			chan = ERR_PTR(rc);
			chan = ERR_PTR(rc);
		}
		}
	}
	}


	spin_unlock_irqrestore(&chan->lock, flags);

	return chan;
	return chan;
}
}
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
@@ -304,20 +306,19 @@ void pcc_mbox_free_channel(struct mbox_chan *chan)
		return;
		return;
	}
	}


	if (pcc_doorbell_irq[id] > 0)
		devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);

	spin_lock_irqsave(&chan->lock, flags);
	spin_lock_irqsave(&chan->lock, flags);
	chan->cl = NULL;
	chan->cl = NULL;
	chan->active_req = NULL;
	chan->active_req = NULL;
	if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
	if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
		chan->txdone_method = TXDONE_BY_POLL;
		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);
	spin_unlock_irqrestore(&chan->lock, flags);
}
}
EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);



/**
/**
 * pcc_send_data - Called from Mailbox Controller code. Used
 * pcc_send_data - Called from Mailbox Controller code. Used
 *		here only to ring the channel doorbell. The PCC client
 *		here only to ring the channel doorbell. The PCC client
+3 −0
Original line number Original line Diff line number Diff line
@@ -191,6 +191,9 @@
#ifndef __init
#ifndef __init
#define __init
#define __init
#endif
#endif
#ifndef __iomem
#define __iomem
#endif


/* Host-dependent types and defines for user-space ACPICA */
/* Host-dependent types and defines for user-space ACPICA */


+12 −11
Original line number Original line Diff line number Diff line
@@ -8,18 +8,19 @@
# as published by the Free Software Foundation; version 2
# as published by the Free Software Foundation; version 2
# of the License.
# of the License.


include ../../../../scripts/Makefile.include
ifeq ($(srctree),)

srctree := $(patsubst %/,%,$(dir $(shell pwd)))
OUTPUT=./
srctree := $(patsubst %/,%,$(dir $(srctree)))
ifeq ("$(origin O)", "command line")
#$(info Determined 'srctree' to be $(srctree))
	OUTPUT := $(O)/
endif
endif


ifneq ($(OUTPUT),)
include $(srctree)/../../scripts/Makefile.include
# check that the output directory actually exists

OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
OUTPUT=$(srctree)/
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
ifeq ("$(origin O)", "command line")
	OUTPUT := $(O)/power/acpi/
endif
endif
#$(info Determined 'OUTPUT' to be $(OUTPUT))


# --- CONFIGURATION BEGIN ---
# --- CONFIGURATION BEGIN ---


@@ -70,8 +71,8 @@ WARNINGS := -Wall
WARNINGS += $(call cc-supports,-Wstrict-prototypes)
WARNINGS += $(call cc-supports,-Wstrict-prototypes)
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)


KERNEL_INCLUDE := ../../../include
KERNEL_INCLUDE := $(OUTPUT)include
ACPICA_INCLUDE := ../../../drivers/acpi/acpica
ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
CFLAGS += $(WARNINGS)
CFLAGS += $(WARNINGS)


+27 −13
Original line number Original line Diff line number Diff line
@@ -8,28 +8,42 @@
# as published by the Free Software Foundation; version 2
# as published by the Free Software Foundation; version 2
# of the License.
# of the License.


$(OUTPUT)$(TOOL): $(TOOL_OBJS) FORCE
objdir := $(OUTPUT)tools/$(TOOL)/
	$(ECHO) "  LD      " $@
toolobjs := $(addprefix $(objdir),$(TOOL_OBJS))
	$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(TOOL_OBJS) -L$(OUTPUT) -o $@
$(OUTPUT)$(TOOL): $(toolobjs) FORCE
	$(ECHO) "  LD      " $(subst $(OUTPUT),,$@)
	$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@
	$(ECHO) "  STRIP   " $(subst $(OUTPUT),,$@)
	$(QUIET) $(STRIPCMD) $@
	$(QUIET) $(STRIPCMD) $@


$(OUTPUT)%.o: %.c
$(KERNEL_INCLUDE):
	$(ECHO) "  CC      " $@
	$(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 $@ $<
	$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<


all: $(OUTPUT)$(TOOL)
all: $(OUTPUT)$(TOOL)
clean:
clean:
	-find $(OUTPUT) \( -not -type d \) \
	$(ECHO) "  RMOBJ   " $(subst $(OUTPUT),,$(objdir))
	$(QUIET) find $(objdir) \( -not -type d \)\
		 -and \( -name '*~' -o -name '*.[oas]' \)\
		 -and \( -name '*~' -o -name '*.[oas]' \)\
	-type f -print \
		 -type f -print | xargs rm -f
	 | xargs rm -f
	$(ECHO) "  RM      " $(TOOL)
	-rm -f $(OUTPUT)$(TOOL)
	$(QUIET) rm -f $(OUTPUT)$(TOOL)
	$(ECHO) "  RMINC   " $(subst $(OUTPUT),,$(KERNEL_INCLUDE))
	$(QUIET) rm -rf $(KERNEL_INCLUDE)


install-tools:
install-tools:
	$(INSTALL) -d $(DESTDIR)${sbindir}
	$(ECHO) "  INST    " $(TOOL)
	$(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)${sbindir}
	$(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
	$(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
uninstall-tools:
uninstall-tools:
	- rm -f $(DESTDIR)${sbindir}/$(TOOL)
	$(ECHO) "  UNINST  " $(TOOL)
	$(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)


install: all install-tools $(EXTRA_INSTALL)
install: all install-tools $(EXTRA_INSTALL)
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
+1 −3
Original line number Original line Diff line number Diff line
@@ -17,9 +17,7 @@ vpath %.c \
	../../os_specific/service_layers\
	../../os_specific/service_layers\
	.
	.
CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\
CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\
	-I.\
	-I.
	-I../../../../../drivers/acpi/acpica\
	-I../../../../../include
LDFLAGS += -lpthread
LDFLAGS += -lpthread
TOOL_OBJS = \
TOOL_OBJS = \
	acpidbg.o
	acpidbg.o
Loading