Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 118c78fc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PM: wakeup_reasons: fix race condition"

parents 2b9fb8cf 896a4f47
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/suspend.h>
#include <trace/events/power.h>
#include <linux/wakeup_reason.h>
#include <linux/irq.h>

static LIST_HEAD(syscore_ops_list);
static DEFINE_MUTEX(syscore_ops_lock);
+7 −3
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#include <linux/irqchip/arm-gic.h>
#include <linux/syscore_ops.h>
#include <linux/msm_rtb.h>

#include <linux/wakeup_reason.h>
#include <asm/cputype.h>
#include <asm/irq.h>
#include <asm/exception.h>
@@ -290,6 +290,7 @@ static void gic_show_resume_irq(struct gic_chip_data *gic)

		pr_warning("%s: %d triggered %s\n", __func__,
					i + gic->irq_offset, name);
		log_base_wakeup_reason(i + gic->irq_offset);
	}
}

@@ -461,12 +462,13 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
	} while (1);
}

static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
static bool gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
{
	struct gic_chip_data *chip_data = irq_get_handler_data(irq);
	struct irq_chip *chip = irq_get_chip(irq);
	unsigned int cascade_irq, gic_irq;
	unsigned long status;
	int handled = false;

	chained_irq_enter(chip, desc);

@@ -482,10 +484,12 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
	if (unlikely(gic_irq < 32 || gic_irq > 1020))
		handle_bad_irq(cascade_irq, desc);
	else
		generic_handle_irq(cascade_irq);
		handled = generic_handle_irq(cascade_irq);


 out:
	chained_irq_exit(chip, desc);
	return handled == true;
}

static struct irq_chip gic_chip = {
+6 −4
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ static struct irq_chip msm_gpio_irq_chip = {
	.irq_set_wake   = msm_gpio_irq_set_wake,
};

static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
bool msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
{
	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
	const struct msm_pingroup *g;
@@ -807,6 +807,7 @@ static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
	int handled = 0;
	u32 val;
	int i;
	bool ret;

	chained_irq_enter(chip, desc);

@@ -819,16 +820,17 @@ static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
		val = readl(pctrl->regs + g->intr_status_reg);
		if (val & BIT(g->intr_status_bit)) {
			irq_pin = irq_find_mapping(gc->irqdomain, i);
			generic_handle_irq(irq_pin);
			handled++;
			handled += generic_handle_irq(irq_pin);
		}
	}

	ret = (handled != 0);
	/* No interrupts were flagged */
	if (handled == 0)
		handle_bad_irq(irq, desc);
		ret = handle_bad_irq(irq, desc);

	chained_irq_exit(chip, desc);
	return ret;
}

/*
+9 −9
Original line number Diff line number Diff line
@@ -442,15 +442,15 @@ static inline int irq_set_parent(int irq, int parent_irq)
 * Built-in IRQ handlers for various IRQ types,
 * callable via desc->handle_irq()
 */
extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
extern void handle_nested_irq(unsigned int irq);
extern bool handle_level_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_edge_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_simple_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_bad_irq(unsigned int irq, struct irq_desc *desc);
extern bool handle_nested_irq(unsigned int irq);

extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
#ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
+3 −2
Original line number Diff line number Diff line
@@ -123,9 +123,10 @@ static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
 * irqchip-style controller then we call the ->handle_irq() handler,
 * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
 */
static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)

static inline bool generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
{
	desc->handle_irq(irq, desc);
	return desc->handle_irq(irq, desc);
}

int generic_handle_irq(unsigned int irq);
Loading