Skip to content

Commit

Permalink
Set TRIGGER_RISING for SSAM wakeup interrupt
Browse files Browse the repository at this point in the history
Setting TRIGGER_RISING is necessary to prevent an IRQ storm. Add
documentation so that this flag is kept until proper handling of this
IRQ has been implemented.

Reverts commit 00e11f0
  • Loading branch information
qzed committed Aug 3, 2020
1 parent 7698291 commit b9fe8f2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion module/surface_sam_ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -4846,12 +4846,24 @@ static irqreturn_t ssam_irq_handle(int irq, void *dev_id)

static int ssam_irq_setup(struct ssam_controller *ctrl)
{
const int irqf = IRQF_SHARED | IRQF_ONESHOT;
struct device *dev = ssam_controller_device(ctrl);
struct gpio_desc *gpiod;
int irq;
int status;

/*
* The actual GPIO interrupt is declared in ACPI as TRIGGER_HIGH.
* However, the GPIO line only gets reset by sending the GPIO callback
* command to SAM (or alternatively the display-on notification). As
* proper handling for this interrupt is not implemented yet, leaving
* the IRQ at TRIGGER_HIGH would cause an IRQ storm (as the callback
* never gets sent and thus the line line never gets reset). To avoid
* this, mark the IRQ as TRIGGER_RISING for now, only creating a single
* interrupt, and let the SAM resume callback during the controller
* resume process clear it.
*/
const int irqf = IRQF_SHARED | IRQF_ONESHOT | IRQF_TRIGGER_RISING;

gpiod = gpiod_get(dev, "ssam_wakeup-int", GPIOD_ASIS);
if (IS_ERR(gpiod))
return PTR_ERR(gpiod);
Expand Down

0 comments on commit b9fe8f2

Please sign in to comment.