stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Adam S Levy <theadamlevy@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 4.9 18/41] pinctrl: cherryview: Add a quirk to make Acer Chromebook keyboard work again
Date: Mon, 10 Jul 2017 19:10:51 +0200	[thread overview]
Message-ID: <20170710171052.623679574@linuxfoundation.org> (raw)
In-Reply-To: <20170710171051.866846041@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mika Westerberg <mika.westerberg@linux.intel.com>

commit 7036502783729c2aaf7a3c24c89087c58721430f upstream.

After commit 47c950d10202 ("pinctrl: cherryview: Do not add all
southwest and north GPIOs to IRQ domain") the driver does not add all
GPIOs to the irqdomain. The reason for that is that those GPIOs cannot
generate IRQs at all, only GPEs (General Purpose Events). This causes
Linux virtual IRQ numbering to change.

However, it seems some CYAN Chromebooks, including Acer Chromebook
hardcodes these Linux IRQ numbers in the ACPI tables of the machine.
Since the numbering is different now, the IRQ meant for keyboard does
not match the Linux virtual IRQ number anymore making the keyboard
non-functional.

Work this around by adding special quirk just for these machines where
we add back all GPIOs to the irqdomain. Rest of the Cherryview/Braswell
based machines will not be affected by the change.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=194945
Fixes: 47c950d10202 ("pinctrl: cherryview: Do not add all southwest and north GPIOs to IRQ domain")
Reported-by: Adam S Levy <theadamlevy@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pinctrl/intel/pinctrl-cherryview.c |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -13,6 +13,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/dmi.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -1524,10 +1525,31 @@ static void chv_gpio_irq_handler(struct
 	chained_irq_exit(chip, desc);
 }
 
+/*
+ * Certain machines seem to hardcode Linux IRQ numbers in their ACPI
+ * tables. Since we leave GPIOs that are not capable of generating
+ * interrupts out of the irqdomain the numbering will be different and
+ * cause devices using the hardcoded IRQ numbers fail. In order not to
+ * break such machines we will only mask pins from irqdomain if the machine
+ * is not listed below.
+ */
+static const struct dmi_system_id chv_no_valid_mask[] = {
+	{
+		/* See https://bugzilla.kernel.org/show_bug.cgi?id=194945 */
+		.ident = "Acer Chromebook (CYAN)",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Edgar"),
+			DMI_MATCH(DMI_BIOS_DATE, "05/21/2016"),
+		},
+	}
+};
+
 static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
 {
 	const struct chv_gpio_pinrange *range;
 	struct gpio_chip *chip = &pctrl->chip;
+	bool need_valid_mask = !dmi_check_system(chv_no_valid_mask);
 	int ret, i, offset;
 
 	*chip = chv_gpio_chip;
@@ -1536,7 +1558,7 @@ static int chv_gpio_probe(struct chv_pin
 	chip->label = dev_name(pctrl->dev);
 	chip->parent = pctrl->dev;
 	chip->base = -1;
-	chip->irq_need_valid_mask = true;
+	chip->irq_need_valid_mask = need_valid_mask;
 
 	ret = devm_gpiochip_add_data(pctrl->dev, chip, pctrl);
 	if (ret) {
@@ -1567,7 +1589,7 @@ static int chv_gpio_probe(struct chv_pin
 		intsel &= CHV_PADCTRL0_INTSEL_MASK;
 		intsel >>= CHV_PADCTRL0_INTSEL_SHIFT;
 
-		if (intsel >= pctrl->community->nirqs)
+		if (need_valid_mask && intsel >= pctrl->community->nirqs)
 			clear_bit(i, chip->irq_valid_mask);
 	}
 

  parent reply	other threads:[~2017-07-10 17:10 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 17:10 [PATCH 4.9 00/41] 4.9.37-stable review Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 01/41] fs: add a VALID_OPEN_FLAGS Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 02/41] fs: completely ignore unknown open flags Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 03/41] driver core: platform: fix race condition with driver_override Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 04/41] ceph: choose readdir frag based on previous readdir reply Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 05/41] tracing/kprobes: Allow to create probe with a module name starting with a digit Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 06/41] [media] media: entity: Fix stream count check Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 08/41] usb: dwc3: replace %p with %pK Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 09/41] USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 10/41] Add USB quirk for HVR-950q to avoid intermittent device resets Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 11/41] usb: usbip: set buffer pointers to NULL after free Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 12/41] usb: Fix typo in the definition of Endpoint[out]Request Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 13/41] USB: core: fix device node leak Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 14/41] mac80211_hwsim: Replace bogus hrtimer clockid Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 15/41] sysctl: dont print negative flag for proc_douintvec Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 16/41] sysctl: report EINVAL if value is larger than UINT_MAX " Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 17/41] pinctrl: qcom: ipq4019: add missing pingroups for pins > 70 Greg Kroah-Hartman
2017-07-10 17:10 ` Greg Kroah-Hartman [this message]
2017-07-10 17:10 ` [PATCH 4.9 19/41] pinctrl: sh-pfc: r8a7794: Swap ATA signals Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 20/41] pinctrl: sh-pfc: r8a7791: Fix SCIF2 pinmux data Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 21/41] pinctrl: sh-pfc: r8a7791: Add missing DVC_MUTE signal Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 22/41] pinctrl: sh-pfc: r8a7795: Fix hscif2_clk_b and hscif4_ctrl Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 23/41] pinctrl: meson: meson8b: fix the NAND DQS pins Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 24/41] pinctrl: stm32: Fix bad function call Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 25/41] pinctrl: sunxi: Fix SPDIF function name for A83T Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 26/41] pinctrl: cherryview: Add terminate entry for dmi_system_id tables Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 28/41] pinctrl: sh-pfc: r8a7791: Add missing HSCIF1 pinmux data Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 29/41] pinctrl: sh-pfc: Update info pointer after SoC-specific init Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 32/41] xhci: Limit USB2 port wake support for AMD Promontory hosts Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 33/41] gfs2: Fix glock rhashtable rcu bug Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 34/41] tpm: fix a kernel memory leak in tpm-sysfs.c Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 36/41] x86/uaccess: Optimize copy_user_enhanced_fast_string() for short strings Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 37/41] ath10k: override CE5 config for QCA9377 Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 38/41] KEYS: Fix an error code in request_master_key() Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 39/41] crypto: drbg - Fixes panic in wait_for_completion call Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 40/41] RDMA/uverbs: Check port number supplied by user verbs cmds Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 41/41] rt286: add Thinkpad Helix 2 to force_combo_jack_table Greg Kroah-Hartman
2017-07-10 22:31 ` [PATCH 4.9 00/41] 4.9.37-stable review Krister Johansen
2017-07-11  9:53   ` Greg Kroah-Hartman
2017-07-11  0:45 ` Guenter Roeck
2017-07-11  9:54 ` Sumit Semwal
2017-07-11 10:37   ` Greg Kroah-Hartman

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=20170710171052.623679574@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=theadamlevy@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).