From: Hans de Goede <hdegoede@redhat.com>
To: Mark Gross <markgross@kernel.org>,
Andy Shevchenko <andy@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: [PATCH 2/5] platform/x86: x86-android-tablets: Fix EBUSY error when requesting IOAPIC IRQs
Date: Wed, 23 Feb 2022 14:31:50 +0100 [thread overview]
Message-ID: <20220223133153.730337-3-hdegoede@redhat.com> (raw)
In-Reply-To: <20220223133153.730337-1-hdegoede@redhat.com>
Sometimes IRQs used by GPIOs in direct-IRQ mode are already registered
because they are used as ACPI "Interrupt () {}" resource for one of the
many bogus I2C devices present in the broken DSDTs of Android x86 tablets.
This is an issue if the existing (bogus) ACPI resource uses different
trigger settings then what is being requested, leading to an -EBUSY
error return of acpi_register_gsi().
Fix this by calling acpi_unregister_gsi() first, so that
the acpi_register_gsi() is allowed to change the trigger settings.
In cases where the GSI has not been registered yet
the acpi_unregister_gsi() is a no-op.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/platform/x86/x86-android-tablets.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c
index f280c82d5ba5..61e526e048c3 100644
--- a/drivers/platform/x86/x86-android-tablets.c
+++ b/drivers/platform/x86/x86-android-tablets.c
@@ -89,6 +89,12 @@ static int x86_acpi_irq_helper_get(const struct x86_acpi_irq_data *data)
switch (data->type) {
case X86_ACPI_IRQ_TYPE_APIC:
+ /*
+ * The DSDT may already reference the GSI in a device skipped by
+ * acpi_quirk_skip_i2c_client_enumeration(). Unregister the GSI
+ * to avoid EBUSY errors in this case.
+ */
+ acpi_unregister_gsi(data->index);
irq = acpi_register_gsi(NULL, data->index, data->trigger, data->polarity);
if (irq < 0)
pr_err("error %d getting APIC IRQ %d\n", irq, data->index);
--
2.35.1
next prev parent reply other threads:[~2022-02-23 13:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-23 13:31 [PATCH 0/5] pinctrl/baytrail platform/x86: SUS6 mux / Lenovo Yoga Tablet 2 support Hans de Goede
2022-02-23 13:31 ` [PATCH 1/5] pinctrl: baytrail: Add pinconf group + function for the pmu_clk Hans de Goede
2022-02-23 14:54 ` Andy Shevchenko
2022-02-23 15:27 ` Andy Shevchenko
2022-02-23 13:31 ` Hans de Goede [this message]
2022-02-23 14:56 ` [PATCH 2/5] platform/x86: x86-android-tablets: Fix EBUSY error when requesting IOAPIC IRQs Andy Shevchenko
2022-02-23 15:16 ` Hans de Goede
2022-02-23 15:38 ` Andy Shevchenko
2022-02-24 16:49 ` Hans de Goede
2022-02-23 13:31 ` [PATCH 3/5] platform/x86: x86-android-tablets: Add Lenovo Yoga Tablet 2 830 / 1050 data Hans de Goede
2022-02-23 15:04 ` Andy Shevchenko
2022-02-23 13:31 ` [PATCH 4/5] platform/x86: x86-android-tablets: Workaround Lenovo Yoga Tablet 2 830/1050 poweroff hang Hans de Goede
2022-02-23 14:58 ` Andy Shevchenko
2022-02-24 16:57 ` Hans de Goede
2022-02-25 16:35 ` Andy Shevchenko
2022-02-23 13:31 ` [PATCH 5/5] platform/x86: x86-android-tablets: Lenovo Yoga Tablet 2 830/1050 sound support Hans de Goede
2022-02-23 15:04 ` Andy Shevchenko
2022-02-23 14:55 ` [PATCH 0/5] pinctrl/baytrail platform/x86: SUS6 mux / Lenovo Yoga Tablet 2 support Andy Shevchenko
2022-02-24 16:43 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220223133153.730337-3-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=andy@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.