From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Sasha Levin <sashal@kernel.org>,
linux-gpio@vger.kernel.org
Subject: [PATCH AUTOSEL 5.1 08/70] pinctrl: intel: Clear interrupt status in mask/unmask callback
Date: Sat, 8 Jun 2019 07:38:47 -0400 [thread overview]
Message-ID: <20190608113950.8033-8-sashal@kernel.org> (raw)
In-Reply-To: <20190608113950.8033-1-sashal@kernel.org>
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
[ Upstream commit 670784fb4ebe54434e263837390e358405031d9e ]
Commit a939bb57cd47 ("pinctrl: intel: implement gpio_irq_enable") was
added because clearing interrupt status bit is required to avoid
unexpected behavior.
Turns out the unmask callback also needs the fix, which can solve weird
IRQ triggering issues on I2C touchpad ELAN1200.
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/intel/pinctrl-intel.c | 37 +++++----------------------
1 file changed, 6 insertions(+), 31 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 3b1818184207..717148d2818c 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -913,35 +913,6 @@ static void intel_gpio_irq_ack(struct irq_data *d)
}
}
-static void intel_gpio_irq_enable(struct irq_data *d)
-{
- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
- struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
- const struct intel_community *community;
- const struct intel_padgroup *padgrp;
- int pin;
-
- pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp);
- if (pin >= 0) {
- unsigned int gpp, gpp_offset, is_offset;
- unsigned long flags;
- u32 value;
-
- gpp = padgrp->reg_num;
- gpp_offset = padgroup_offset(padgrp, pin);
- is_offset = community->is_offset + gpp * 4;
-
- raw_spin_lock_irqsave(&pctrl->lock, flags);
- /* Clear interrupt status first to avoid unexpected interrupt */
- writel(BIT(gpp_offset), community->regs + is_offset);
-
- value = readl(community->regs + community->ie_offset + gpp * 4);
- value |= BIT(gpp_offset);
- writel(value, community->regs + community->ie_offset + gpp * 4);
- raw_spin_unlock_irqrestore(&pctrl->lock, flags);
- }
-}
-
static void intel_gpio_irq_mask_unmask(struct irq_data *d, bool mask)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
@@ -954,15 +925,20 @@ static void intel_gpio_irq_mask_unmask(struct irq_data *d, bool mask)
if (pin >= 0) {
unsigned int gpp, gpp_offset;
unsigned long flags;
- void __iomem *reg;
+ void __iomem *reg, *is;
u32 value;
gpp = padgrp->reg_num;
gpp_offset = padgroup_offset(padgrp, pin);
reg = community->regs + community->ie_offset + gpp * 4;
+ is = community->regs + community->is_offset + gpp * 4;
raw_spin_lock_irqsave(&pctrl->lock, flags);
+
+ /* Clear interrupt status first to avoid unexpected interrupt */
+ writel(BIT(gpp_offset), is);
+
value = readl(reg);
if (mask)
value &= ~BIT(gpp_offset);
@@ -1106,7 +1082,6 @@ static irqreturn_t intel_gpio_irq(int irq, void *data)
static struct irq_chip intel_gpio_irqchip = {
.name = "intel-gpio",
- .irq_enable = intel_gpio_irq_enable,
.irq_ack = intel_gpio_irq_ack,
.irq_mask = intel_gpio_irq_mask,
.irq_unmask = intel_gpio_irq_unmask,
--
2.20.1
next prev parent reply other threads:[~2019-06-08 11:55 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-08 11:38 [PATCH AUTOSEL 5.1 01/70] iio: adc: ads124: avoid buffer overflow Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 02/70] iio: imu: mpu6050: Fix FIFO layout for ICM20602 Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 03/70] iio: dac: ds4422/ds4424 fix chip verification Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 04/70] iio: adc: ti-ads8688: fix timestamp is not updated in buffer Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 05/70] staging: erofs: set sb->s_root to NULL when failing from __getname() Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 06/70] Staging: vc04_services: Fix a couple error codes Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 07/70] staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup() Sasha Levin
2019-06-08 11:38 ` Sasha Levin [this message]
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 09/70] netfilter: nf_tables: fix oops during rule dump Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 10/70] perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 11/70] netfilter: nf_queue: fix reinject verdict handling Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 12/70] netfilter: nft_fib: Fix existence check support Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 13/70] ipvs: Fix use-after-free in ip_vs_in Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 14/70] selftests: netfilter: missing error check when setting up veth interface Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 15/70] netfilter: nat: fix udp checksum corruption Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 16/70] clk: ti: clkctrl: Fix clkdm_clk handling Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 17/70] powerpc/powernv: Return for invalid IMC domain Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 18/70] usb: xhci: Fix a potential null pointer dereference in xhci_debugfs_create_endpoint() Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 19/70] mISDN: make sure device name is NUL terminated Sasha Levin
2019-06-08 11:38 ` [PATCH AUTOSEL 5.1 20/70] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 21/70] perf/ring_buffer: Fix exposing a temporarily decreased data_head Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 22/70] perf/ring_buffer: Add ordering to rb->nest increment Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 23/70] perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 24/70] gpio: fix gpio-adp5588 build errors Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 25/70] efi/x86/Add missing error handling to old_memmap 1:1 mapping code Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 26/70] net: stmmac: update rx tail pointer register to fix rx dma hang issue Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 27/70] net: stmmac: fix csr_clk can't be zero issue Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 28/70] net: stmmac: dwmac-mediatek: modify csr_clk value to fix mdio read/write fail Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 29/70] io_uring: Fix __io_uring_register() false success Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 30/70] dpaa2-eth: Fix potential spectre issue Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 31/70] dpaa2-eth: Use PTR_ERR_OR_ZERO where appropriate Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 32/70] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE() Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 33/70] ACPI/PCI: PM: Add missing wakeup.flags.valid checks Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 34/70] PCI: PM: Avoid possible suspend-to-idle issue Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 35/70] loop: Don't change loop device under exclusive opener Sasha Levin
2019-06-10 9:00 ` Jan Kara
2019-06-19 20:11 ` Sasha Levin
2019-06-20 9:08 ` Jan Kara
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 36/70] drm/etnaviv: lock MMU while dumping core Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 37/70] net: aquantia: tx clean budget logic error Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 38/70] net: aquantia: fix LRO with FCS error Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 39/70] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 40/70] i2c: mlxcpld: Fix wrong initialization order in probe Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 41/70] ALSA: hda - Force polling mode on CNL for fixing codec communication Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 42/70] configfs: Fix use-after-free when accessing sd->s_dentry Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 43/70] perf data: Fix 'strncat may truncate' build failure with recent gcc Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 44/70] s390/zcrypt: Fix wrong dispatching for control domain CPRBs Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 45/70] perf namespace: Protect reading thread's namespace Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 46/70] perf record: Fix s390 missing module symbol and warning for non-root users Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 47/70] ia64: fix build errors by exporting paddr_to_nid() Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 48/70] dpaa_eth: use only online CPU portals Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 49/70] xen/pvcalls: Remove set but not used variable Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 50/70] xenbus: Avoid deadlock during suspend due to open transactions Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 51/70] dfs_cache: fix a wrong use of kfree in flush_cache_ent() Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 52/70] KVM: PPC: Book3S HV: Use new mutex to synchronize MMU setup Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 53/70] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 54/70] KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 55/70] ALSA: fireface: Use ULL suffixes for 64-bit constants Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 56/70] arm64: fix syscall_fn_t type Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 57/70] arm64: use the correct function type in SYSCALL_DEFINE0 Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 58/70] arm64: use the correct function type for __arm64_sys_ni_syscall Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 59/70] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 60/70] blk-mq: Fix memory leak in error handling Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 61/70] net: phylink: ensure consistent phy interface mode Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 62/70] net: phy: dp83867: fix speed 10 in sgmii mode Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 63/70] net: phy: dp83867: increase SGMII autoneg timer duration Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 64/70] net: phy: dp83867: Set up RGMII TX delay Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 65/70] scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route() Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 66/70] scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 67/70] scsi: scsi_dh_alua: Fix possible null-ptr-deref Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 68/70] scsi: libsas: delete sas port if expander discover failed Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 69/70] mlxsw: spectrum: Prevent force of 56G Sasha Levin
2019-06-08 11:39 ` [PATCH AUTOSEL 5.1 70/70] ocfs2: fix error path kobject memory leak Sasha Levin
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=20190608113950.8033-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=kai.heng.feng@canonical.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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 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).